
create table ADMIN_FILE_UPLOAD_INFO
(
  FILE_ID       VARCHAR2(32) not null,
  FILE_NAME     VARCHAR2(100) not null,
  FILE_PATH     VARCHAR2(100) not null,
  FILE_SIZE     NUMBER(20),
  EXT_NAME      VARCHAR2(10),
  PARENT_FOLDER VARCHAR2(100),
  BUS_NO        VARCHAR2(32) not null,
  UPLOAD_TIME   VARCHAR2(20),
  FILE_REMARK   VARCHAR2(100)
);
comment on table ADMIN_FILE_UPLOAD_INFO
  is '上传文件信息';
comment on column ADMIN_FILE_UPLOAD_INFO.FILE_ID
  is '唯一主键';
comment on column ADMIN_FILE_UPLOAD_INFO.FILE_NAME
  is '文件名称';
comment on column ADMIN_FILE_UPLOAD_INFO.FILE_PATH
  is '文件存储路径 ';
comment on column ADMIN_FILE_UPLOAD_INFO.FILE_SIZE
  is '文件大小';
comment on column ADMIN_FILE_UPLOAD_INFO.EXT_NAME
  is '文件扩展名';
comment on column ADMIN_FILE_UPLOAD_INFO.PARENT_FOLDER
  is '文件虚拟文件夹';
comment on column ADMIN_FILE_UPLOAD_INFO.BUS_NO
  is '业务流水号';
comment on column ADMIN_FILE_UPLOAD_INFO.UPLOAD_TIME
  is '上传时间';
comment on column ADMIN_FILE_UPLOAD_INFO.FILE_REMARK
  is '备注';
alter table ADMIN_FILE_UPLOAD_INFO
  add primary key (FILE_ID)
  using index;


create table ADMIN_SM_AUTH_INFO
(
  AUTH_ID     VARCHAR2(32) not null,
  AUTH_NAME   VARCHAR2(100),
  BEAN_NAME   VARCHAR2(100),
  AUTH_REMARK VARCHAR2(500) not null
);
comment on table ADMIN_SM_AUTH_INFO
  is '认证信息表';
comment on column ADMIN_SM_AUTH_INFO.AUTH_ID
  is '记录编号';
comment on column ADMIN_SM_AUTH_INFO.AUTH_NAME
  is '认证类型名称';
comment on column ADMIN_SM_AUTH_INFO.BEAN_NAME
  is '实现类名称';
comment on column ADMIN_SM_AUTH_INFO.AUTH_REMARK
  is '备注';
alter table ADMIN_SM_AUTH_INFO
  add primary key (AUTH_ID)
  using index ;
alter table ADMIN_SM_AUTH_INFO
  add unique (AUTH_NAME)
  using index ;


create table ADMIN_SM_AUTH_RECO
(
  AUTH_RECO_ID VARCHAR2(32) not null,
  SYS_ID       VARCHAR2(32) not null,
  AUTHOBJ_TYPE VARCHAR2(10) not null,
  AUTHOBJ_ID   VARCHAR2(32) not null,
  AUTHRES_TYPE VARCHAR2(10) not null,
  AUTHRES_ID   VARCHAR2(32) not null,
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null,
  MENU_ID      VARCHAR2(32)
);
comment on table ADMIN_SM_AUTH_RECO
  is '资源对象授权记录表(含菜单、控制点、数据权限)';
comment on column ADMIN_SM_AUTH_RECO.AUTH_RECO_ID
  is '记录编号';
comment on column ADMIN_SM_AUTH_RECO.SYS_ID
  is '逻辑系统记录编号';
comment on column ADMIN_SM_AUTH_RECO.AUTHOBJ_TYPE
  is '授权对象类型（R-角色，U-用户，D-部门，G-机构，OU-对象组）';
comment on column ADMIN_SM_AUTH_RECO.AUTHOBJ_ID
  is '授权对象记录编号';
comment on column ADMIN_SM_AUTH_RECO.AUTHRES_TYPE
  is '授权资源类型（M-菜单，C-控制点，D-数据权限）';
comment on column ADMIN_SM_AUTH_RECO.AUTHRES_ID
  is '授权资源记录编号';
comment on column ADMIN_SM_AUTH_RECO.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_AUTH_RECO.LAST_CHG_DT
  is '最新变更时间';
comment on column ADMIN_SM_AUTH_RECO.MENU_ID
  is '菜单ID';
alter table ADMIN_SM_AUTH_RECO
  add primary key (AUTH_RECO_ID)
  using index ;


create table ADMIN_SM_BUSI_FUNC
(
  FUNC_ID      VARCHAR2(32) not null,
  MOD_ID       VARCHAR2(32) not null,
  FUNC_NAME    VARCHAR2(100) not null,
  FUNC_DESC    VARCHAR2(250),
  FUNC_URL     VARCHAR2(400) not null,
  FUNC_URL_JS  VARCHAR2(400),
  FUNC_URL_CSS VARCHAR2(400),
  FUNC_ORDER   NUMBER not null,
  FUNC_ICON    VARCHAR2(200) not null,
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null
);
comment on table ADMIN_SM_BUSI_FUNC
  is '系统业务功能表';
comment on column ADMIN_SM_BUSI_FUNC.FUNC_ID
  is '记录编号';
comment on column ADMIN_SM_BUSI_FUNC.MOD_ID
  is '所属功能模块编号';
comment on column ADMIN_SM_BUSI_FUNC.FUNC_NAME
  is '功能点名称';
comment on column ADMIN_SM_BUSI_FUNC.FUNC_DESC
  is '功能点描述';
comment on column ADMIN_SM_BUSI_FUNC.FUNC_URL
  is 'URL链接';
comment on column ADMIN_SM_BUSI_FUNC.FUNC_URL_JS
  is 'JS链接';
comment on column ADMIN_SM_BUSI_FUNC.FUNC_URL_CSS
  is 'CSS链接';
comment on column ADMIN_SM_BUSI_FUNC.FUNC_ORDER
  is '顺序';
comment on column ADMIN_SM_BUSI_FUNC.FUNC_ICON
  is '图标';
comment on column ADMIN_SM_BUSI_FUNC.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_BUSI_FUNC.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_BUSI_FUNC
  add primary key (FUNC_ID)
  using index ;


create table ADMIN_SM_CREL_STRA
(
  CREL_ID      VARCHAR2(32) not null,
  SYS_ID       VARCHAR2(32) not null,
  CERL_NAME    VARCHAR2(50),
  ENABLE_FLAG  VARCHAR2(10) not null,
  CREL_DETAIL  VARCHAR2(500) not null,
  ACTION_TYPE  VARCHAR2(100) not null,
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null
);
comment on table ADMIN_SM_CREL_STRA
  is '认证策略参数表';
comment on column ADMIN_SM_CREL_STRA.CREL_ID
  is '记录编号';
comment on column ADMIN_SM_CREL_STRA.SYS_ID
  is '逻辑系统编号';
comment on column ADMIN_SM_CREL_STRA.CERL_NAME
  is '策略名称';
comment on column ADMIN_SM_CREL_STRA.ENABLE_FLAG
  is '是否启用 1:是 2:否';
comment on column ADMIN_SM_CREL_STRA.CREL_DETAIL
  is '策略明细';
comment on column ADMIN_SM_CREL_STRA.ACTION_TYPE
  is '执行动作1: 冻结用户 2:禁止 3：警告';
comment on column ADMIN_SM_CREL_STRA.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_CREL_STRA.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_CREL_STRA
  add primary key (CREL_ID)
  using index ;


create table ADMIN_SM_DATA_AUTH
(
  AUTH_ID      VARCHAR2(32) not null,
  CONTR_ID     VARCHAR2(32) not null,
  AUTH_TMPL_ID VARCHAR2(32) not null,
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null
);
comment on table ADMIN_SM_DATA_AUTH
  is '数据权限表';
comment on column ADMIN_SM_DATA_AUTH.AUTH_ID
  is '记录编号';
comment on column ADMIN_SM_DATA_AUTH.CONTR_ID
  is '控制点记录编号(为*时表示默认过滤器)';
comment on column ADMIN_SM_DATA_AUTH.AUTH_TMPL_ID
  is '权限模板编号';
comment on column ADMIN_SM_DATA_AUTH.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_DATA_AUTH.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_DATA_AUTH
  add primary key (AUTH_ID)
  using index ;


create table ADMIN_SM_DATA_AUTH_TMPL
(
  AUTH_TMPL_ID   VARCHAR2(32) not null,
  AUTH_TMPL_NAME VARCHAR2(32) not null,
  SQL_STRING     CLOB not null,
  SQL_NAME       VARCHAR2(100) not null,
  CONTR_INCLUDE  CLOB not null,
  LAST_CHG_USR   VARCHAR2(32) not null,
  LAST_CHG_DT    VARCHAR2(20) not null,
  PRIORITY       VARCHAR2(100) default 0
);
comment on table ADMIN_SM_DATA_AUTH_TMPL
  is '数据权限模板表';
comment on column ADMIN_SM_DATA_AUTH_TMPL.AUTH_TMPL_ID
  is '记录编号';
comment on column ADMIN_SM_DATA_AUTH_TMPL.AUTH_TMPL_NAME
  is '数据权限模板名';
comment on column ADMIN_SM_DATA_AUTH_TMPL.SQL_STRING
  is '数据权限SQL条件';
comment on column ADMIN_SM_DATA_AUTH_TMPL.SQL_NAME
  is 'SQL占位符名称';
comment on column ADMIN_SM_DATA_AUTH_TMPL.CONTR_INCLUDE
  is '可用的控制点记录编号(*表示都可用)';
comment on column ADMIN_SM_DATA_AUTH_TMPL.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_DATA_AUTH_TMPL.LAST_CHG_DT
  is '最新变更时间';
comment on column ADMIN_SM_DATA_AUTH_TMPL.PRIORITY
  is '优先级,值越小优先级越高';
alter table ADMIN_SM_DATA_AUTH_TMPL
  add primary key (AUTH_TMPL_ID)
  using index;
alter table ADMIN_SM_DATA_AUTH_TMPL
  add unique (AUTH_TMPL_NAME)
  using index ;


create table ADMIN_SM_DATA_FILTER
(
  FILTER_ID    VARCHAR2(32) not null,
  FILTER_NAME  VARCHAR2(200),
  QUERY_URL    VARCHAR2(200),
  CLASS_DESC   VARCHAR2(2000),
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null
);
comment on table ADMIN_SM_DATA_FILTER
  is '数据权限过滤器表';
comment on column ADMIN_SM_DATA_FILTER.FILTER_ID
  is '记录编号';
comment on column ADMIN_SM_DATA_FILTER.FILTER_NAME
  is '过滤器名';
comment on column ADMIN_SM_DATA_FILTER.QUERY_URL
  is '查询URL';
comment on column ADMIN_SM_DATA_FILTER.CLASS_DESC
  is '过滤器描述';
comment on column ADMIN_SM_DATA_FILTER.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_DATA_FILTER.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_DATA_FILTER
  add primary key (FILTER_ID)
  using index ;

create table ADMIN_SM_DATA_FILTER_SUB
(
  FILTER_SUB_ID VARCHAR2(32) not null,
  FILTER_ID     VARCHAR2(32) not null,
  SQL_STRING    VARCHAR2(2000) not null,
  SQL_NAME      VARCHAR2(100) not null,
  LAST_CHG_USR  VARCHAR2(32) not null,
  LAST_CHG_DT   VARCHAR2(20) not null
);
comment on table ADMIN_SM_DATA_FILTER_SUB
  is '数据权限过滤器明细表';
comment on column ADMIN_SM_DATA_FILTER_SUB.FILTER_SUB_ID
  is '记录编号';
comment on column ADMIN_SM_DATA_FILTER_SUB.FILTER_ID
  is '所属过滤器编号';
comment on column ADMIN_SM_DATA_FILTER_SUB.SQL_STRING
  is '数据过滤SQL条件';
comment on column ADMIN_SM_DATA_FILTER_SUB.SQL_NAME
  is '数据过滤名称';
comment on column ADMIN_SM_DATA_FILTER_SUB.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_DATA_FILTER_SUB.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_DATA_FILTER_SUB
  add primary key (FILTER_SUB_ID)
  using index ;


create table ADMIN_SM_DPT
(
  DPT_ID        VARCHAR2(32) not null,
  DPT_CDE       VARCHAR2(100) not null,
  DPT_NAME      VARCHAR2(100) not null,
  BELONG_ORG_ID VARCHAR2(32) not null,
  UP_DPT_ID     VARCHAR2(32),
  DPT_STS       VARCHAR2(10) not null,
  LAST_CHG_USR  VARCHAR2(32) not null,
  LAST_CHG_DT   VARCHAR2(20) not null
);
comment on table ADMIN_SM_DPT
  is '系统部门表';
comment on column ADMIN_SM_DPT.DPT_ID
  is '记录编号';
comment on column ADMIN_SM_DPT.DPT_CDE
  is '部门代码';
comment on column ADMIN_SM_DPT.DPT_NAME
  is '部门名称';
comment on column ADMIN_SM_DPT.BELONG_ORG_ID
  is '所属机构编号';
comment on column ADMIN_SM_DPT.UP_DPT_ID
  is '上级部门记录编号';
comment on column ADMIN_SM_DPT.DPT_STS
  is '状态：对应字典项=NORM_STS A：生效 I：失效 W：待生效';
comment on column ADMIN_SM_DPT.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_DPT.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_DPT
  add primary key (DPT_ID)
  using index ;


create table ADMIN_SM_DUTY
(
  DUTY_ID       VARCHAR2(32) not null,
  DUTY_CDE      VARCHAR2(100) not null,
  DUTY_NAME     VARCHAR2(100) not null,
  BELONG_ORG_ID VARCHAR2(32) not null,
  DUTY_REMARK   VARCHAR2(500),
  DUTY_STS      VARCHAR2(10) not null,
  LAST_CHG_USR  VARCHAR2(32) not null,
  LAST_CHG_DT   VARCHAR2(20) not null
);
comment on table ADMIN_SM_DUTY
  is '系统岗位表';
comment on column ADMIN_SM_DUTY.DUTY_ID
  is '记录编号';
comment on column ADMIN_SM_DUTY.DUTY_CDE
  is '岗位代码';
comment on column ADMIN_SM_DUTY.DUTY_NAME
  is '岗位名称';
comment on column ADMIN_SM_DUTY.BELONG_ORG_ID
  is '所属机构编号';
comment on column ADMIN_SM_DUTY.DUTY_REMARK
  is '备注';
comment on column ADMIN_SM_DUTY.DUTY_STS
  is '状态：对应字典项=NORM_STS A：生效 I：失效 W：待生效';
comment on column ADMIN_SM_DUTY.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_DUTY.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_DUTY
  add primary key (DUTY_ID)
  using index;


create table ADMIN_SM_FUNC_MOD
(
  MOD_ID       VARCHAR2(32) not null,
  MOD_NAME     VARCHAR2(50) not null,
  MOD_DESC     VARCHAR2(254),
  IS_OUTER     VARCHAR2(10) not null,
  IS_APP       VARCHAR2(2000),
  USER_NAME    VARCHAR2(100),
  PASSWORD     VARCHAR2(100),
  USER_KEY     VARCHAR2(100),
  PWD_KEY      VARCHAR2(100),
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null
);
comment on table ADMIN_SM_FUNC_MOD
  is '系统功能模块表';
comment on column ADMIN_SM_FUNC_MOD.MOD_ID
  is '记录编号';
comment on column ADMIN_SM_FUNC_MOD.MOD_NAME
  is '模块名称';
comment on column ADMIN_SM_FUNC_MOD.MOD_DESC
  is '模块描述';
comment on column ADMIN_SM_FUNC_MOD.IS_OUTER
  is '是否外部系统';
comment on column ADMIN_SM_FUNC_MOD.IS_APP
  is '是否APP功能';
comment on column ADMIN_SM_FUNC_MOD.USER_NAME
  is '外部系统登录名';
comment on column ADMIN_SM_FUNC_MOD.PASSWORD
  is '外部系统登录密码';
comment on column ADMIN_SM_FUNC_MOD.USER_KEY
  is '外部系统用户变量名称';
comment on column ADMIN_SM_FUNC_MOD.PWD_KEY
  is '外部系统密码变量名称';
comment on column ADMIN_SM_FUNC_MOD.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_FUNC_MOD.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_FUNC_MOD
  add primary key (MOD_ID)
  using index ;


create table ADMIN_SM_INSTU
(
  INSTU_ID     VARCHAR2(32) not null,
  SYS_ID       VARCHAR2(32) not null,
  INSTU_CDE    VARCHAR2(10) not null,
  INSTU_NAME   VARCHAR2(100) not null,
  JOIN_DT      VARCHAR2(20),
  INSTU_ADDR   VARCHAR2(200),
  ZIP_CDE      VARCHAR2(6),
  CONT_TEL     VARCHAR2(25),
  CONT_USR     VARCHAR2(100),
  INSTU_STS    VARCHAR2(10),
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null
);
comment on table ADMIN_SM_INSTU
  is '金融机构表';
comment on column ADMIN_SM_INSTU.INSTU_ID
  is '记录编号';
comment on column ADMIN_SM_INSTU.SYS_ID
  is '逻辑系统记录编号';
comment on column ADMIN_SM_INSTU.INSTU_CDE
  is '金融机构代码';
comment on column ADMIN_SM_INSTU.INSTU_NAME
  is '金融机构名称';
comment on column ADMIN_SM_INSTU.JOIN_DT
  is '进入日期';
comment on column ADMIN_SM_INSTU.INSTU_ADDR
  is '地址';
comment on column ADMIN_SM_INSTU.ZIP_CDE
  is '邮编';
comment on column ADMIN_SM_INSTU.CONT_TEL
  is '联系电话';
comment on column ADMIN_SM_INSTU.CONT_USR
  is '联系人';
comment on column ADMIN_SM_INSTU.INSTU_STS
  is '状态：对应字典项=NORM_STS A：生效 I：失效 W：待生效';
comment on column ADMIN_SM_INSTU.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_INSTU.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_INSTU
  add primary key (INSTU_ID)
  using index;


create table ADMIN_SM_LOG
(
  LOG_ID       VARCHAR2(32) not null,
  USER_ID      VARCHAR2(32) not null,
  OPER_TIME    VARCHAR2(100),
  OPER_OBJ_ID  VARCHAR2(100),
  BEFORE_VALUE VARCHAR2(300),
  AFTER_VALUE  VARCHAR2(300),
  OPER_FLAG    VARCHAR2(10),
  LOG_TYPE_ID  VARCHAR2(10),
  CONTENT      VARCHAR2(2000),
  ORG_ID       VARCHAR2(100),
  LOGIN_IP     VARCHAR2(50)
);
comment on table ADMIN_SM_LOG
  is '系统操作日志表';
comment on column ADMIN_SM_LOG.LOG_ID
  is '记录编号';
comment on column ADMIN_SM_LOG.USER_ID
  is '用户ID';
comment on column ADMIN_SM_LOG.OPER_TIME
  is '操作时间';
comment on column ADMIN_SM_LOG.OPER_OBJ_ID
  is '操作对象ID';
comment on column ADMIN_SM_LOG.BEFORE_VALUE
  is '操作前值';
comment on column ADMIN_SM_LOG.AFTER_VALUE
  is '操作后值';
comment on column ADMIN_SM_LOG.OPER_FLAG
  is '操作标志';
comment on column ADMIN_SM_LOG.LOG_TYPE_ID
  is '日志类型';
comment on column ADMIN_SM_LOG.CONTENT
  is '日志内容';
comment on column ADMIN_SM_LOG.ORG_ID
  is '操作者机构';
comment on column ADMIN_SM_LOG.LOGIN_IP
  is '登录IP';
alter table ADMIN_SM_LOG
  add primary key (LOG_ID)
  using index ;


create table ADMIN_SM_LOGIC_SYS
(
  SYS_ID      VARCHAR2(32) not null,
  AUTH_ID     VARCHAR2(32) not null,
  SYS_VERSION VARCHAR2(10),
  SYS_NAME    VARCHAR2(100) not null,
  SYS_DESC    VARCHAR2(254),
  SYS_STS     VARCHAR2(10) not null,
  IS_SSO      VARCHAR2(10),
  SYS_CODE    VARCHAR2(32),
  I18N_KEY    VARCHAR2(32)
);
comment on table ADMIN_SM_LOGIC_SYS
  is '系统逻辑系统表';
comment on column ADMIN_SM_LOGIC_SYS.SYS_ID
  is '记录编号';
comment on column ADMIN_SM_LOGIC_SYS.AUTH_ID
  is '认证类型';
comment on column ADMIN_SM_LOGIC_SYS.SYS_VERSION
  is '版本号';
comment on column ADMIN_SM_LOGIC_SYS.SYS_NAME
  is '逻辑系统名称';
comment on column ADMIN_SM_LOGIC_SYS.SYS_DESC
  is '逻辑系统描述';
comment on column ADMIN_SM_LOGIC_SYS.SYS_STS
  is '逻辑系统状态';
comment on column ADMIN_SM_LOGIC_SYS.IS_SSO
  is '是否单点登录';
comment on column ADMIN_SM_LOGIC_SYS.SYS_CODE
  is '系统简称';
comment on column ADMIN_SM_LOGIC_SYS.I18N_KEY
  is '逻辑系统国际化key值';
alter table ADMIN_SM_LOGIC_SYS
  add primary key (SYS_ID)
  using index ;
alter table ADMIN_SM_LOGIC_SYS
  add unique (SYS_NAME)
  using index;
alter table ADMIN_SM_LOGIC_SYS
  add unique (SYS_CODE)
  using index ;


create table ADMIN_SM_LOOKUP
(
  LOOKUP_ID      VARCHAR2(32) not null,
  INSTU_ID       VARCHAR2(32),
  LOOKUP_TYPE_ID VARCHAR2(32) not null,
  LOOKUP_CODE    VARCHAR2(100) not null,
  LOOKUP_NAME    VARCHAR2(200),
  LAST_CHG_USR   VARCHAR2(32) not null,
  LAST_CHG_DT    VARCHAR2(20) not null
);
comment on table ADMIN_SM_LOOKUP
  is '数据字典类别表';
comment on column ADMIN_SM_LOOKUP.LOOKUP_ID
  is '记录编号';
comment on column ADMIN_SM_LOOKUP.INSTU_ID
  is '金融机构编号';
comment on column ADMIN_SM_LOOKUP.LOOKUP_TYPE_ID
  is '所属目录编号';
comment on column ADMIN_SM_LOOKUP.LOOKUP_CODE
  is '字典类别英文别名';
comment on column ADMIN_SM_LOOKUP.LOOKUP_NAME
  is '字典类别名称';
comment on column ADMIN_SM_LOOKUP.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_LOOKUP.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_LOOKUP
  add primary key (LOOKUP_ID)
  using index;


create table ADMIN_SM_LOOKUP_ITEM
(
  LOOKUP_ITEM_ID      VARCHAR2(32) not null,
  LOOKUP_CODE         VARCHAR2(100) not null,
  UP_LOOKUP_ITEM_ID   VARCHAR2(32),
  LOOKUP_ITEM_CODE    VARCHAR2(200) not null,
  LOOKUP_ITEM_NAME    VARCHAR2(200) not null,
  LOOKUP_ITEM_COMMENT VARCHAR2(200),
  LAST_CHG_USR        VARCHAR2(32) not null,
  LAST_CHG_DT         VARCHAR2(20) not null,
  LOOKUP_ITEM_ORDER   NUMBER(8)
);
comment on table ADMIN_SM_LOOKUP_ITEM
  is '数据字典内容表';
comment on column ADMIN_SM_LOOKUP_ITEM.LOOKUP_ITEM_ID
  is '记录编号';
comment on column ADMIN_SM_LOOKUP_ITEM.LOOKUP_CODE
  is '字典类别英文别名';
comment on column ADMIN_SM_LOOKUP_ITEM.UP_LOOKUP_ITEM_ID
  is '上级字典内容编号';
comment on column ADMIN_SM_LOOKUP_ITEM.LOOKUP_ITEM_CODE
  is '字典代码';
comment on column ADMIN_SM_LOOKUP_ITEM.LOOKUP_ITEM_NAME
  is '字典名称';
comment on column ADMIN_SM_LOOKUP_ITEM.LOOKUP_ITEM_COMMENT
  is '字典备注说明';
comment on column ADMIN_SM_LOOKUP_ITEM.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_LOOKUP_ITEM.LAST_CHG_DT
  is '最新变更时间';
comment on column ADMIN_SM_LOOKUP_ITEM.LOOKUP_ITEM_ORDER
  is '字典项排序';
alter table ADMIN_SM_LOOKUP_ITEM
  add primary key (LOOKUP_ITEM_ID)
  using index ;


create table ADMIN_SM_LOOKUP_TYPE
(
  LOOKUP_TYPE_ID    VARCHAR2(32) not null,
  LOOKUP_TYPE_NAME  VARCHAR2(100) not null,
  UP_LOOKUP_TYPE_ID VARCHAR2(32),
  INSTU_ID          VARCHAR2(32),
  LAST_CHG_USR      VARCHAR2(32) not null,
  LAST_CHG_DT       VARCHAR2(20) not null
);
comment on table ADMIN_SM_LOOKUP_TYPE
  is '数据字典类别目录表';
comment on column ADMIN_SM_LOOKUP_TYPE.LOOKUP_TYPE_ID
  is '记录编号';
comment on column ADMIN_SM_LOOKUP_TYPE.LOOKUP_TYPE_NAME
  is '目录名称';
comment on column ADMIN_SM_LOOKUP_TYPE.UP_LOOKUP_TYPE_ID
  is '上级目录编号';
comment on column ADMIN_SM_LOOKUP_TYPE.INSTU_ID
  is '金融机构编号';
comment on column ADMIN_SM_LOOKUP_TYPE.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_LOOKUP_TYPE.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_LOOKUP_TYPE
  add primary key (LOOKUP_TYPE_ID)
  using index ;


create table ADMIN_SM_MENU
(
  MENU_ID      VARCHAR2(32) not null,
  SYS_ID       VARCHAR2(32) not null,
  FUNC_ID      VARCHAR2(32),
  UP_MENU_ID   VARCHAR2(32),
  MENU_NAME    VARCHAR2(50) not null,
  MENU_ORDER   NUMBER,
  MENU_ICON    VARCHAR2(100),
  MENU_TIP     VARCHAR2(50),
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null,
  I18N_KEY     VARCHAR2(32)
);
comment on table ADMIN_SM_MENU
  is '系统菜单表';
comment on column ADMIN_SM_MENU.MENU_ID
  is '记录编号';
comment on column ADMIN_SM_MENU.SYS_ID
  is '逻辑系统记录编号';
comment on column ADMIN_SM_MENU.FUNC_ID
  is '业务功能编号';
comment on column ADMIN_SM_MENU.UP_MENU_ID
  is '上级菜单编号';
comment on column ADMIN_SM_MENU.MENU_NAME
  is '菜单名称';
comment on column ADMIN_SM_MENU.MENU_ORDER
  is '顺序';
comment on column ADMIN_SM_MENU.MENU_ICON
  is '图标';
comment on column ADMIN_SM_MENU.MENU_TIP
  is '说明(菜单描述)';
comment on column ADMIN_SM_MENU.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_MENU.LAST_CHG_DT
  is '最新变更时间';
comment on column ADMIN_SM_MENU.I18N_KEY
  is '菜单国际化key值';
alter table ADMIN_SM_MENU
  add primary key (MENU_ID)
  using index ;


create table ADMIN_SM_MESSAGE
(
  MESSAGE_ID    VARCHAR2(32) not null,
  CODE          VARCHAR2(20) not null,
  MESSAGE_LEVEL VARCHAR2(20) not null,
  MESSAGE       VARCHAR2(1000) not null,
  MESSAGE_TYPE  VARCHAR2(20),
  FUNC_NAME     VARCHAR2(40),
  LAST_CHG_USR  VARCHAR2(32) not null,
  LAST_CHG_DT   VARCHAR2(20) not null
);
comment on table ADMIN_SM_MESSAGE
  is '提示信息管理表';
comment on column ADMIN_SM_MESSAGE.MESSAGE_ID
  is '消息编号';
comment on column ADMIN_SM_MESSAGE.CODE
  is '信息码';
comment on column ADMIN_SM_MESSAGE.MESSAGE_LEVEL
  is '信息级别:success成功 info信息 warning警告 error错误';
comment on column ADMIN_SM_MESSAGE.MESSAGE
  is '提示内容';
comment on column ADMIN_SM_MESSAGE.MESSAGE_TYPE
  is '消息类别：COMINFO系统级通用提示 DBERR数据库错误提示 MODULEINFO模块提示';
comment on column ADMIN_SM_MESSAGE.FUNC_NAME
  is '所属模块名称';
comment on column ADMIN_SM_MESSAGE.LAST_CHG_USR
  is '最后修改用户';
comment on column ADMIN_SM_MESSAGE.LAST_CHG_DT
  is '最后修改时间';
alter table ADMIN_SM_MESSAGE
  add primary key (MESSAGE_ID)
  using index ;

create table ADMIN_SM_NOTICE
(
  NOTICE_ID       VARCHAR2(32) not null,
  NOTICE_TITLE    VARCHAR2(500),
  NOTICE_LEVEL    VARCHAR2(10),
  ACTIVE_DATE     VARCHAR2(20),
  IS_TOP          VARCHAR2(10),
  TOP_ACTIVE_DATE VARCHAR2(20),
  NOTICE_CONTENT  VARCHAR2(2000),
  PUB_STS         VARCHAR2(10),
  PUB_TIME        VARCHAR2(20),
  PUB_USER_ID     VARCHAR2(32),
  PUB_USER_NAME   VARCHAR2(100),
  PUB_ORG_ID      VARCHAR2(32),
  PUB_ORG_NAME    VARCHAR2(100),
  CREATOR_ID      VARCHAR2(32),
  CREATOR_NAME    VARCHAR2(100),
  CREATOR_TIME    VARCHAR2(20)
);
comment on table ADMIN_SM_NOTICE
  is '系统公告表';
comment on column ADMIN_SM_NOTICE.NOTICE_ID
  is '公告编号';
comment on column ADMIN_SM_NOTICE.NOTICE_TITLE
  is '公告标题';
comment on column ADMIN_SM_NOTICE.NOTICE_LEVEL
  is '公告重要程度';
comment on column ADMIN_SM_NOTICE.ACTIVE_DATE
  is '有效期至';
comment on column ADMIN_SM_NOTICE.IS_TOP
  is '是否置顶';
comment on column ADMIN_SM_NOTICE.TOP_ACTIVE_DATE
  is '置顶有效期';
comment on column ADMIN_SM_NOTICE.NOTICE_CONTENT
  is '公告内容(存富文本表记录编号)';
comment on column ADMIN_SM_NOTICE.PUB_STS
  is '发布状态（状态：对应字典项=NORM_STS C：未发布O：已发布）';
comment on column ADMIN_SM_NOTICE.PUB_TIME
  is '发布时间';
comment on column ADMIN_SM_NOTICE.PUB_USER_ID
  is '公告发布人编号';
comment on column ADMIN_SM_NOTICE.PUB_USER_NAME
  is '公告发布人姓名';
comment on column ADMIN_SM_NOTICE.PUB_ORG_ID
  is '发布机构编号';
comment on column ADMIN_SM_NOTICE.PUB_ORG_NAME
  is '发布机构名称';
comment on column ADMIN_SM_NOTICE.CREATOR_ID
  is '创建人编号';
comment on column ADMIN_SM_NOTICE.CREATOR_NAME
  is '创建人姓名';
comment on column ADMIN_SM_NOTICE.CREATOR_TIME
  is '创建时间';
alter table ADMIN_SM_NOTICE
  add primary key (NOTICE_ID)
  using index ;

create table ADMIN_SM_NOTICE_READ
(
  READ_ID   VARCHAR2(32) not null,
  NOTICE_ID VARCHAR2(32),
  USER_ID   VARCHAR2(32),
  READ_TIME VARCHAR2(20)
);
comment on table ADMIN_SM_NOTICE_READ
  is '系统公告用户查阅历史表';
comment on column ADMIN_SM_NOTICE_READ.READ_ID
  is '记录编号';
comment on column ADMIN_SM_NOTICE_READ.NOTICE_ID
  is '公告编号';
comment on column ADMIN_SM_NOTICE_READ.USER_ID
  is '用户编号';
comment on column ADMIN_SM_NOTICE_READ.READ_TIME
  is '阅读时间';
alter table ADMIN_SM_NOTICE_READ
  add primary key (READ_ID)
  using index ;


create table ADMIN_SM_NOTICE_RECIVE
(
  RECIVE_ID     VARCHAR2(32) not null,
  NOTICE_ID     VARCHAR2(32),
  RECIVE_TYPE   VARCHAR2(10),
  RECIVE_OGJ_ID VARCHAR2(32)
);
comment on table ADMIN_SM_NOTICE_RECIVE
  is '系统公告表接收对象表';
comment on column ADMIN_SM_NOTICE_RECIVE.RECIVE_ID
  is '记录编号';
comment on column ADMIN_SM_NOTICE_RECIVE.NOTICE_ID
  is '公告编号';
comment on column ADMIN_SM_NOTICE_RECIVE.RECIVE_TYPE
  is '对象类型';
comment on column ADMIN_SM_NOTICE_RECIVE.RECIVE_OGJ_ID
  is '对象记录编号';
alter table ADMIN_SM_NOTICE_RECIVE
  add primary key (RECIVE_ID)
  using index ;


create table ADMIN_SM_ORG
(
  ORG_ID       VARCHAR2(32) not null,
  INSTU_ID     VARCHAR2(32) not null,
  ORG_CODE     VARCHAR2(100) not null,
  ORG_NAME     VARCHAR2(100) not null,
  UP_ORG_ID    VARCHAR2(32),
  ORG_LEVEL    VARCHAR2(10) not null,
  ORG_ADDR     VARCHAR2(200),
  ZIP_CDE      VARCHAR2(6),
  CONT_TEL     VARCHAR2(25),
  CONT_USR     VARCHAR2(100),
  ORG_STS      VARCHAR2(10) not null,
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null
);
comment on table ADMIN_SM_ORG
  is '系统机构表';
comment on column ADMIN_SM_ORG.ORG_ID
  is '记录编号';
comment on column ADMIN_SM_ORG.INSTU_ID
  is '金融机构编号';
comment on column ADMIN_SM_ORG.ORG_CODE
  is '机构代码';
comment on column ADMIN_SM_ORG.ORG_NAME
  is '机构名称';
comment on column ADMIN_SM_ORG.UP_ORG_ID
  is '上级机构记录编号';
comment on column ADMIN_SM_ORG.ORG_LEVEL
  is '机构层级';
comment on column ADMIN_SM_ORG.ORG_ADDR
  is '地址';
comment on column ADMIN_SM_ORG.ZIP_CDE
  is '邮编';
comment on column ADMIN_SM_ORG.CONT_TEL
  is '联系电话';
comment on column ADMIN_SM_ORG.CONT_USR
  is '联系人';
comment on column ADMIN_SM_ORG.ORG_STS
  is '状态：对应字典项=NORM_STS A：生效 I：失效 W：待生效';
comment on column ADMIN_SM_ORG.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_ORG.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_ORG
  add primary key (ORG_ID)
  using index;


create table ADMIN_SM_PASSWORD_LOG
(
  LOG_ID       VARCHAR2(32) not null,
  PWD_UP_TIME  VARCHAR2(20) default '' not null,
  PWD_UPED     VARCHAR2(150) default '' not null,
  UPDATE_USER  VARCHAR2(100) default '' not null,
  USER_ID      VARCHAR2(32) default '' not null,
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null
);
comment on table ADMIN_SM_PASSWORD_LOG
  is '密码修改记录表';
comment on column ADMIN_SM_PASSWORD_LOG.LOG_ID
  is '记录编号';
comment on column ADMIN_SM_PASSWORD_LOG.PWD_UP_TIME
  is '密码修改时间';
comment on column ADMIN_SM_PASSWORD_LOG.PWD_UPED
  is '被修改的密码';
comment on column ADMIN_SM_PASSWORD_LOG.UPDATE_USER
  is '修改者id';
comment on column ADMIN_SM_PASSWORD_LOG.USER_ID
  is '用户ID';
comment on column ADMIN_SM_PASSWORD_LOG.LAST_CHG_USR
  is '最近一次修改人';
comment on column ADMIN_SM_PASSWORD_LOG.LAST_CHG_DT
  is '最近一次修改时间';
alter table ADMIN_SM_PASSWORD_LOG
  add primary key (LOG_ID)
  using index ;


create table ADMIN_SM_PROP
(
  PROP_ID      VARCHAR2(32) not null,
  PROP_NAME    VARCHAR2(100) not null,
  PROP_DESC    VARCHAR2(2000),
  PROP_VALUE   VARCHAR2(2000) not null,
  PROP_REMARK  VARCHAR2(2000),
  INSTU_ID     VARCHAR2(32) not null,
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null
);
comment on table ADMIN_SM_PROP
  is '系统参数表';
comment on column ADMIN_SM_PROP.PROP_ID
  is '记录编号';
comment on column ADMIN_SM_PROP.PROP_NAME
  is '属性名';
comment on column ADMIN_SM_PROP.PROP_DESC
  is '属性描述';
comment on column ADMIN_SM_PROP.PROP_VALUE
  is '属性值';
comment on column ADMIN_SM_PROP.PROP_REMARK
  is '备注';
comment on column ADMIN_SM_PROP.INSTU_ID
  is '金融机构编号';
comment on column ADMIN_SM_PROP.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_PROP.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_PROP
  add primary key (PROP_ID)
  using index ;

create table ADMIN_SM_RES_CONTR
(
  CONTR_ID     VARCHAR2(32) not null,
  FUNC_ID      VARCHAR2(32) not null,
  CONTR_CODE   VARCHAR2(100) not null,
  CONTR_NAME   VARCHAR2(200) not null,
  CONTR_URL    VARCHAR2(100),
  CONTR_REMARK VARCHAR2(1000),
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null,
  METHOD_TYPE  VARCHAR2(20)
);
comment on table ADMIN_SM_RES_CONTR
  is '系统功能控制点表';
comment on column ADMIN_SM_RES_CONTR.CONTR_ID
  is '记录编号';
comment on column ADMIN_SM_RES_CONTR.FUNC_ID
  is '所属业务功能编号';
comment on column ADMIN_SM_RES_CONTR.CONTR_CODE
  is '控制操作代码';
comment on column ADMIN_SM_RES_CONTR.CONTR_NAME
  is '控制操作名称';
comment on column ADMIN_SM_RES_CONTR.CONTR_URL
  is '控制操作URL(用于后台校验时使用)';
comment on column ADMIN_SM_RES_CONTR.CONTR_REMARK
  is '备注';
comment on column ADMIN_SM_RES_CONTR.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_RES_CONTR.LAST_CHG_DT
  is '最新变更时间';
comment on column ADMIN_SM_RES_CONTR.METHOD_TYPE
  is '请求类型';
alter table ADMIN_SM_RES_CONTR
  add primary key (CONTR_ID)
  using index;


create table ADMIN_SM_RICHEDIT_FILE_INFO
(
  FILE_ID       VARCHAR2(32) not null,
  FILE_NAME     VARCHAR2(100) not null,
  FILE_PATH     VARCHAR2(100) not null,
  FILE_SIZE     NUMBER(20),
  EXT_NAME      VARCHAR2(10),
  PARENT_FOLDER VARCHAR2(100),
  BUS_NO        VARCHAR2(32) not null,
  UPLOAD_TIME   VARCHAR2(20),
  FILE_REMARK   VARCHAR2(100)
);
comment on column ADMIN_SM_RICHEDIT_FILE_INFO.FILE_ID
  is '唯一主键';
comment on column ADMIN_SM_RICHEDIT_FILE_INFO.FILE_NAME
  is '文件名称';
comment on column ADMIN_SM_RICHEDIT_FILE_INFO.FILE_PATH
  is '文件存储路径 ';
comment on column ADMIN_SM_RICHEDIT_FILE_INFO.FILE_SIZE
  is '文件大小';
comment on column ADMIN_SM_RICHEDIT_FILE_INFO.EXT_NAME
  is '文件扩展名';
comment on column ADMIN_SM_RICHEDIT_FILE_INFO.PARENT_FOLDER
  is '文件虚拟文件夹';
comment on column ADMIN_SM_RICHEDIT_FILE_INFO.BUS_NO
  is '业务流水号';
comment on column ADMIN_SM_RICHEDIT_FILE_INFO.UPLOAD_TIME
  is '上传时间';
comment on column ADMIN_SM_RICHEDIT_FILE_INFO.FILE_REMARK
  is '备注';
alter table ADMIN_SM_RICHEDIT_FILE_INFO
  add primary key (FILE_ID)
  using index ;

create table ADMIN_SM_RICHEDIT_INFO
(
  RICHEDIT_ID VARCHAR2(32) not null,
  REL_MOD     VARCHAR2(10),
  REL_ID      VARCHAR2(32) not null,
  CONTENT     CLOB
);
comment on table ADMIN_SM_RICHEDIT_INFO
  is '富文本信息表';
comment on column ADMIN_SM_RICHEDIT_INFO.RICHEDIT_ID
  is '富文本编号';
comment on column ADMIN_SM_RICHEDIT_INFO.REL_MOD
  is '关联业务模块（NOTICE-公告；）';
comment on column ADMIN_SM_RICHEDIT_INFO.REL_ID
  is '关联业务主表编号';
comment on column ADMIN_SM_RICHEDIT_INFO.CONTENT
  is '文本内容';
alter table ADMIN_SM_RICHEDIT_INFO
  add primary key (RICHEDIT_ID)
  using index;


create table ADMIN_SM_ROLE
(
  ROLE_ID      VARCHAR2(32) not null,
  ROLE_CODE    VARCHAR2(100) not null,
  ROLE_NAME    VARCHAR2(200) not null,
  ORG_ID       VARCHAR2(32),
  ROLE_LEVEL   VARCHAR2(10),
  ROLE_STS     VARCHAR2(10) not null,
  LAST_CHG_USR VARCHAR2(32) not null,
  LAST_CHG_DT  VARCHAR2(20) not null
);
comment on table ADMIN_SM_ROLE
  is '系统角色表';
comment on column ADMIN_SM_ROLE.ROLE_ID
  is '记录编号';
comment on column ADMIN_SM_ROLE.ROLE_CODE
  is '角色代码';
comment on column ADMIN_SM_ROLE.ROLE_NAME
  is '角色名称';
comment on column ADMIN_SM_ROLE.ORG_ID
  is '所属机构编号';
comment on column ADMIN_SM_ROLE.ROLE_LEVEL
  is '角色层级';
comment on column ADMIN_SM_ROLE.ROLE_STS
  is '状态：对应字典项=NORM_STS A：生效 I：失效 W：待生效';
comment on column ADMIN_SM_ROLE.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_ROLE.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_ROLE
  add primary key (ROLE_ID)
  using index;

create table ADMIN_SM_USER
(
  USER_ID             VARCHAR2(32) not null,
  LOGIN_CODE          VARCHAR2(100) not null,
  USER_NAME           VARCHAR2(100) not null,
  CERT_TYPE           VARCHAR2(10),
  CERT_NO             VARCHAR2(100),
  USER_CODE           VARCHAR2(100),
  DEADLINE            VARCHAR2(20),
  ORG_ID              VARCHAR2(32) not null,
  DPT_ID              VARCHAR2(32),
  USER_PASSWORD       VARCHAR2(100) not null,
  USER_SEX            VARCHAR2(10),
  USER_BIRTHDAY       VARCHAR2(20),
  USER_EMAIL          VARCHAR2(100),
  USER_MOBILEPHONE    VARCHAR2(100),
  USER_OFFICETEL      VARCHAR2(100),
  USER_EDUCATION      VARCHAR2(10),
  USER_CERTIFICATE    VARCHAR2(200),
  ENTRANTS_DATE       VARCHAR2(20),
  POSITION_TIME       VARCHAR2(20),
  FINANCIAL_JOB_TIME  VARCHAR2(20),
  POSITION_DEGREE     VARCHAR2(10),
  USER_AVATAR         VARCHAR2(200),
  OFFEN_IP            VARCHAR2(200),
  USER_STS            VARCHAR2(10) not null,
  LAST_LOGIN_TIME     VARCHAR2(20),
  LAST_EDIT_PASS_TIME VARCHAR2(20),
  LAST_CHG_USR        VARCHAR2(32) not null,
  LAST_CHG_DT         VARCHAR2(20) not null,
  HEAD_PORT           VARCHAR2(200),
  FINGER_PRINT        VARCHAR2(500),
  FACE_PRINT          VARCHAR2(500),
  GESTURE_PASSWORD    VARCHAR2(500),
  VOICE_PRINT         VARCHAR2(500)
);
comment on table ADMIN_SM_USER
  is '系统用户表';
comment on column ADMIN_SM_USER.USER_ID
  is '记录编号';
comment on column ADMIN_SM_USER.LOGIN_CODE
  is '登录代码';
comment on column ADMIN_SM_USER.USER_NAME
  is '姓名';
comment on column ADMIN_SM_USER.CERT_TYPE
  is '证件类型';
comment on column ADMIN_SM_USER.CERT_NO
  is '证件号码';
comment on column ADMIN_SM_USER.USER_CODE
  is '员工号';
comment on column ADMIN_SM_USER.DEADLINE
  is '有效期到';
comment on column ADMIN_SM_USER.ORG_ID
  is '所属机构编号';
comment on column ADMIN_SM_USER.DPT_ID
  is '所属部门编号';
comment on column ADMIN_SM_USER.USER_PASSWORD
  is '密码';
comment on column ADMIN_SM_USER.USER_SEX
  is '性别';
comment on column ADMIN_SM_USER.USER_BIRTHDAY
  is '生日';
comment on column ADMIN_SM_USER.USER_EMAIL
  is '邮箱';
comment on column ADMIN_SM_USER.USER_MOBILEPHONE
  is '移动电话';
comment on column ADMIN_SM_USER.USER_OFFICETEL
  is '办公电话';
comment on column ADMIN_SM_USER.USER_EDUCATION
  is '学历';
comment on column ADMIN_SM_USER.USER_CERTIFICATE
  is '资格证书';
comment on column ADMIN_SM_USER.ENTRANTS_DATE
  is '入职日期';
comment on column ADMIN_SM_USER.POSITION_TIME
  is '任职时间';
comment on column ADMIN_SM_USER.FINANCIAL_JOB_TIME
  is '从业时间';
comment on column ADMIN_SM_USER.POSITION_DEGREE
  is '职级';
comment on column ADMIN_SM_USER.USER_AVATAR
  is '用户头像';
comment on column ADMIN_SM_USER.OFFEN_IP
  is '常用IP，逗号分隔';
comment on column ADMIN_SM_USER.USER_STS
  is '状态：对应字典项=NORM_STS A：生效 I：失效 W：待生效';
comment on column ADMIN_SM_USER.LAST_LOGIN_TIME
  is '最近登录时间';
comment on column ADMIN_SM_USER.LAST_EDIT_PASS_TIME
  is '最近一次修改密码时间';
comment on column ADMIN_SM_USER.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_USER.LAST_CHG_DT
  is '最新变更时间';
comment on column ADMIN_SM_USER.HEAD_PORT
  is '头像地址';
comment on column ADMIN_SM_USER.FINGER_PRINT
  is '指纹信息';
comment on column ADMIN_SM_USER.FACE_PRINT
  is '面部信息';
comment on column ADMIN_SM_USER.GESTURE_PASSWORD
  is '手势密码';
comment on column ADMIN_SM_USER.VOICE_PRINT
  is '声纹信息';
alter table ADMIN_SM_USER
  add primary key (USER_ID)
  using index ;


create table ADMIN_SM_USER_DUTY_REL
(
  USER_DUTY_REL_ID VARCHAR2(32) not null,
  USER_ID          VARCHAR2(32) not null,
  DUTY_ID          VARCHAR2(32) not null,
  REL_STS          VARCHAR2(10) not null,
  LAST_CHG_USR     VARCHAR2(32) not null,
  LAST_CHG_DT      VARCHAR2(20) not null
);
comment on table ADMIN_SM_USER_DUTY_REL
  is '用户角色关联表';
comment on column ADMIN_SM_USER_DUTY_REL.USER_DUTY_REL_ID
  is '记录编号';
comment on column ADMIN_SM_USER_DUTY_REL.USER_ID
  is '用户编号';
comment on column ADMIN_SM_USER_DUTY_REL.DUTY_ID
  is '岗位编号';
comment on column ADMIN_SM_USER_DUTY_REL.REL_STS
  is '状态：对应字典项=NORM_STS A：生效 I：失效 W：待生效';
comment on column ADMIN_SM_USER_DUTY_REL.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_USER_DUTY_REL.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_USER_DUTY_REL
  add primary key (USER_DUTY_REL_ID)
  using index ;

create table ADMIN_SM_USER_MENU_SHCH
(
  ID           VARCHAR2(32) not null,
  LOGIN_CODE   VARCHAR2(100) not null,
  MENU_ID      VARCHAR2(32) not null,
  MENU_ORDER   NUMBER,
  MENU_VISIBLE VARCHAR2(2)
);
comment on column ADMIN_SM_USER_MENU_SHCH.ID
  is '主键';
comment on column ADMIN_SM_USER_MENU_SHCH.LOGIN_CODE
  is '用户登录代码';
comment on column ADMIN_SM_USER_MENU_SHCH.MENU_ID
  is '菜单id';
comment on column ADMIN_SM_USER_MENU_SHCH.MENU_ORDER
  is '菜单顺序';
comment on column ADMIN_SM_USER_MENU_SHCH.MENU_VISIBLE
  is '菜单是否可见';
alter table ADMIN_SM_USER_MENU_SHCH
  add primary key (ID)
  using index;


create table ADMIN_SM_USER_MGR_ORG
(
  USER_MGR_ORG_ID VARCHAR2(32) not null,
  USER_ID         VARCHAR2(32) not null,
  ORG_ID          VARCHAR2(32) not null,
  REL_STS         VARCHAR2(10) not null,
  LAST_CHG_USR    VARCHAR2(32) not null,
  LAST_CHG_DT     VARCHAR2(20) not null
);
comment on table ADMIN_SM_USER_MGR_ORG
  is '用户授权管理机构表';
comment on column ADMIN_SM_USER_MGR_ORG.USER_MGR_ORG_ID
  is '记录编号';
comment on column ADMIN_SM_USER_MGR_ORG.USER_ID
  is '用户编号';
comment on column ADMIN_SM_USER_MGR_ORG.ORG_ID
  is '被授权管理机构编号';
comment on column ADMIN_SM_USER_MGR_ORG.REL_STS
  is '状态：对应字典项=NORM_STS A：生效 I：失效 W：待生效';
comment on column ADMIN_SM_USER_MGR_ORG.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_USER_MGR_ORG.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_USER_MGR_ORG
  add primary key (USER_MGR_ORG_ID)
  using index;


create table ADMIN_SM_USER_ROLE_REL
(
  USER_ROLE_REL_ID VARCHAR2(32) not null,
  USER_ID          VARCHAR2(32) not null,
  ROLE_ID          VARCHAR2(32) not null,
  REL_STS          VARCHAR2(10) not null,
  LAST_CHG_USR     VARCHAR2(32) not null,
  LAST_CHG_DT      VARCHAR2(20) not null
);
comment on table ADMIN_SM_USER_ROLE_REL
  is '用户角色关联表';
comment on column ADMIN_SM_USER_ROLE_REL.USER_ROLE_REL_ID
  is '记录编号';
comment on column ADMIN_SM_USER_ROLE_REL.USER_ID
  is '用户编号';
comment on column ADMIN_SM_USER_ROLE_REL.ROLE_ID
  is '角色编号';
comment on column ADMIN_SM_USER_ROLE_REL.REL_STS
  is '状态：对应字典项=NORM_STS A：生效 I：失效 W：待生效';
comment on column ADMIN_SM_USER_ROLE_REL.LAST_CHG_USR
  is '最新变更用户';
comment on column ADMIN_SM_USER_ROLE_REL.LAST_CHG_DT
  is '最新变更时间';
alter table ADMIN_SM_USER_ROLE_REL
  add primary key (USER_ROLE_REL_ID)
  using index ;


create table AUTH_CLIENT
(
  CLIENT_ID   VARCHAR2(255) not null,
  CLIENT_NAME VARCHAR2(255) not null,
  DESCRIPTION VARCHAR2(255),
  CLIENT_PWD  VARCHAR2(255) not null
);
alter table AUTH_CLIENT
  add primary key (CLIENT_ID)
  using index ;

create table AUTH_CLIENT_SERVICE
(
  ID         NUMBER(11) not null,
  SERVICE_ID NUMBER(11) not null,
  CLIENT_ID  VARCHAR2(255) not null
);
alter table AUTH_CLIENT_SERVICE
  add primary key (ID)
  using index ;


create table AUTH_SERVICE
(
  ID           NUMBER(11) not null,
  SERVICE_NAME VARCHAR2(255) not null,
  DESCRIPTION  VARCHAR2(255),
  SERVICE_URI  VARCHAR2(255) not null,
  METHOD       VARCHAR2(8) not null,
  AVAILABLE    NUMBER(4) default 0 not null
);
comment on column AUTH_SERVICE.SERVICE_NAME
  is '服务名';
comment on column AUTH_SERVICE.DESCRIPTION
  is '服务描述';
comment on column AUTH_SERVICE.SERVICE_URI
  is 'API 资源位置';
comment on column AUTH_SERVICE.METHOD
  is '请求方式 GET, POST';
comment on column AUTH_SERVICE.AVAILABLE
  is '可用状态';
alter table AUTH_SERVICE
  add primary key (ID)
  using index;


create table SEQUENCE_CONFIG
(
  ID             VARCHAR2(36) not null,
  SEQ_NAME       VARCHAR2(50),
  SEQ_ID         VARCHAR2(50),
  STARTVALUE     NUMBER(22),
  MAXIMUMVALUE   NUMBER(22),
  INCREMENTVALUE NUMBER(9),
  IS_CYCLE       VARCHAR2(2),
  CACHEVALUE     NUMBER(9),
  SEQ_TEMPLET    VARCHAR2(200),
  SEQ_PLACE      NUMBER(9),
  ZERO_FILL      VARCHAR2(2),
  SEQ_CREATE     VARCHAR2(2),
  CURRENT_VALUE  VARCHAR2(20),
  LAST_CHG_DT    VARCHAR2(20),
  LAST_CHG_USR   VARCHAR2(32)
);
comment on table SEQUENCE_CONFIG
  is '序列号模版配置';
comment on column SEQUENCE_CONFIG.ID
  is '主键ID';
comment on column SEQUENCE_CONFIG.SEQ_NAME
  is '序列名称';
comment on column SEQUENCE_CONFIG.SEQ_ID
  is '序列ID';
comment on column SEQUENCE_CONFIG.STARTVALUE
  is '开始值';
comment on column SEQUENCE_CONFIG.MAXIMUMVALUE
  is '最大值';
comment on column SEQUENCE_CONFIG.INCREMENTVALUE
  is '自增值';
comment on column SEQUENCE_CONFIG.IS_CYCLE
  is '是否循环';
comment on column SEQUENCE_CONFIG.CACHEVALUE
  is '缓存值';
comment on column SEQUENCE_CONFIG.SEQ_TEMPLET
  is '序列模版';
comment on column SEQUENCE_CONFIG.SEQ_PLACE
  is '序列用的位数';
comment on column SEQUENCE_CONFIG.ZERO_FILL
  is '不足位数是否用0补全';
comment on column SEQUENCE_CONFIG.SEQ_CREATE
  is '序列是否已生成';
comment on column SEQUENCE_CONFIG.CURRENT_VALUE
  is '当前序列值';
comment on column SEQUENCE_CONFIG.LAST_CHG_DT
  is '最新变更时间';
comment on column SEQUENCE_CONFIG.LAST_CHG_USR
  is '最新变更用户';
alter table SEQUENCE_CONFIG
  add primary key (ID)
  using index;

create table N_WF_BIZ
(
  biz_type  VARCHAR2(32) not null,
  flow_id   NUMBER(10) not null,
  flow_name VARCHAR2(32),
  page_url  VARCHAR2(60),
  ext       VARCHAR2(60),
  org_id    VARCHAR2(32)
)
;
comment on table N_WF_BIZ
  is '流程适用业务配置';
comment on column N_WF_BIZ.biz_type
  is '业务类型';
comment on column N_WF_BIZ.flow_id
  is '流程ID';
comment on column N_WF_BIZ.flow_name
  is '流程名称';
comment on column N_WF_BIZ.page_url
  is '流程业务页面';
comment on column N_WF_BIZ.ext
  is '备注';
comment on column N_WF_BIZ.org_id
  is '机构id';
alter table N_WF_BIZ
  add constraint PK_WF_BIZ primary key (BIZ_TYPE, FLOW_ID);


create table N_WF_BIZ_NODE
(
  biz_type  VARCHAR2(32) not null,
  flow_id   NUMBER(10) not null,
  node_id   VARCHAR2(32) not null,
  node_name VARCHAR2(32),
  page_url  VARCHAR2(60),
  ext       VARCHAR2(60),
  org_id    VARCHAR2(32)
)
;
comment on table N_WF_BIZ_NODE
  is '节点适用业务配置';
comment on column N_WF_BIZ_NODE.biz_type
  is '业务类型';
comment on column N_WF_BIZ_NODE.flow_id
  is '流程id';
comment on column N_WF_BIZ_NODE.node_id
  is '节点id';
comment on column N_WF_BIZ_NODE.node_name
  is '节点名称';
comment on column N_WF_BIZ_NODE.page_url
  is '页面url';
comment on column N_WF_BIZ_NODE.ext
  is '扩展信息';
comment on column N_WF_BIZ_NODE.org_id
  is '机构id';
alter table N_WF_BIZ_NODE
  add constraint PK_N_WF_BIZ_NODE primary key (BIZ_TYPE, FLOW_ID, NODE_ID);


create table N_WF_COMMENT
(
  comment_id       VARCHAR2(32) not null,
  instance_id      VARCHAR2(32),
  node_id          VARCHAR2(10),
  user_id          VARCHAR2(32),
  comment_sign     VARCHAR2(5),
  start_time       VARCHAR2(32),
  node_level       NUMBER(10),
  user_comment     VARCHAR2(500),
  user_name        VARCHAR2(32),
  node_name        VARCHAR2(32),
  main_instance_id VARCHAR2(32),
  ext              CLOB
)
;
comment on table N_WF_COMMENT
  is '用户评论表';
comment on column N_WF_COMMENT.comment_id
  is '主键';
comment on column N_WF_COMMENT.instance_id
  is '实例id';
comment on column N_WF_COMMENT.node_id
  is '节点id';
comment on column N_WF_COMMENT.user_id
  is '用户id';
comment on column N_WF_COMMENT.comment_sign
  is '用户结论';
comment on column N_WF_COMMENT.start_time
  is '评论时间';
comment on column N_WF_COMMENT.node_level
  is '节点等级';
comment on column N_WF_COMMENT.user_comment
  is '用户评论';
comment on column N_WF_COMMENT.user_name
  is '用户名称';
comment on column N_WF_COMMENT.node_name
  is '节点名称';
comment on column N_WF_COMMENT.main_instance_id
  is '主流程ID';
comment on column N_WF_COMMENT.ext
  is '扩展信息json字符串';
alter table N_WF_COMMENT
  add constraint PK_N_WF_COMMENT primary key (COMMENT_ID);


create table N_WF_COMMENT_HIS
(
  comment_id       VARCHAR2(32) not null,
  instance_id      VARCHAR2(32),
  node_id          VARCHAR2(10),
  user_id          VARCHAR2(32),
  comment_sign     VARCHAR2(5),
  start_time       VARCHAR2(32),
  node_level       NUMBER(10),
  user_comment     VARCHAR2(500),
  user_name        VARCHAR2(32),
  node_name        VARCHAR2(32),
  main_instance_id VARCHAR2(32),
  ext              CLOB
)
;
comment on table N_WF_COMMENT_HIS
  is '用户评论历史表';
comment on column N_WF_COMMENT_HIS.comment_id
  is '主键';
comment on column N_WF_COMMENT_HIS.instance_id
  is '实例id';
comment on column N_WF_COMMENT_HIS.node_id
  is '节点id';
comment on column N_WF_COMMENT_HIS.user_id
  is '用户id';
comment on column N_WF_COMMENT_HIS.comment_sign
  is '用户结论';
comment on column N_WF_COMMENT_HIS.start_time
  is '评论时间';
comment on column N_WF_COMMENT_HIS.node_level
  is '节点等级';
comment on column N_WF_COMMENT_HIS.user_comment
  is '用户评价';
comment on column N_WF_COMMENT_HIS.user_name
  is '用户名称';
comment on column N_WF_COMMENT_HIS.node_name
  is '节点名称';
comment on column N_WF_COMMENT_HIS.main_instance_id
  is '主流程ID';
comment on column N_WF_COMMENT_HIS.ext
  is '扩展信息json字符串';
alter table N_WF_COMMENT_HIS
  add constraint PK_N_WF_COMMENT_END primary key (COMMENT_ID);


create table N_WF_COPY_USER
(
  instance_id VARCHAR2(32) not null,
  node_id     VARCHAR2(5) not null,
  user_id     VARCHAR2(32) not null
)
;
comment on table N_WF_COPY_USER
  is '抄送表';
comment on column N_WF_COPY_USER.instance_id
  is '实例id';
comment on column N_WF_COPY_USER.node_id
  is '节点id';
comment on column N_WF_COPY_USER.user_id
  is '抄送人员id';


create table N_WF_ENTRUST
(
  biz_type        VARCHAR2(32) not null,
  user_id         VARCHAR2(32) not null,
  user_name       VARCHAR2(32),
  other_user_id   VARCHAR2(32),
  other_user_name VARCHAR2(32),
  start_time      VARCHAR2(32),
  end_time        VARCHAR2(32),
  org_id          VARCHAR2(32)
)
;
comment on table N_WF_ENTRUST
  is '委托人员配置';
comment on column N_WF_ENTRUST.biz_type
  is '业务申请类型';
comment on column N_WF_ENTRUST.user_id
  is '申请人';
comment on column N_WF_ENTRUST.user_name
  is '申请人姓名';
comment on column N_WF_ENTRUST.other_user_id
  is '委托人';
comment on column N_WF_ENTRUST.other_user_name
  is '委托人姓名';
comment on column N_WF_ENTRUST.start_time
  is '开始时间';
comment on column N_WF_ENTRUST.end_time
  is '结束时间';
comment on column N_WF_ENTRUST.org_id
  is '机构id';
alter table N_WF_ENTRUST
  add constraint PK_N_WF_ENTRUST primary key (BIZ_TYPE, USER_ID);


create table N_WF_ENTRUST_USER
(
  instance_id     VARCHAR2(32) not null,
  node_id         VARCHAR2(32) not null,
  user_id         VARCHAR2(32) not null,
  other_user_id   VARCHAR2(32),
  user_name       VARCHAR2(32),
  other_user_name VARCHAR2(32)
)
;
comment on table N_WF_ENTRUST_USER
  is '委托人待办表';
comment on column N_WF_ENTRUST_USER.instance_id
  is '实例id';
comment on column N_WF_ENTRUST_USER.node_id
  is '节点id';
comment on column N_WF_ENTRUST_USER.user_id
  is '用户ID';
comment on column N_WF_ENTRUST_USER.other_user_id
  is '被委托人';
comment on column N_WF_ENTRUST_USER.user_name
  is '用户名';
comment on column N_WF_ENTRUST_USER.other_user_name
  is '被委托人名';
alter table N_WF_ENTRUST_USER
  add constraint PK_N_WF_ENTRUST_USER primary key (INSTANCE_ID, NODE_ID, USER_ID);


create table N_WF_EXCEPTION
(
  pk_id          VARCHAR2(32) not null,
  instance_id    VARCHAR2(32),
  flow_id        NUMBER(10),
  node_id        VARCHAR2(32),
  node_name      VARCHAR2(32),
  flow_name      VARCHAR2(50),
  biz_param      CLOB,
  exception_info CLOB,
  exception_time VARCHAR2(32),
  user_id        VARCHAR2(32),
  user_name      VARCHAR2(50),
  biz_id         VARCHAR2(32),
  biz_type       VARCHAR2(32),
  op_type        VARCHAR2(32)
)
;
comment on table N_WF_EXCEPTION
  is '后业务处理异常记录表';
comment on column N_WF_EXCEPTION.pk_id
  is '主键';
comment on column N_WF_EXCEPTION.instance_id
  is '实例id';
comment on column N_WF_EXCEPTION.flow_id
  is '流程id';
comment on column N_WF_EXCEPTION.node_id
  is '节点ID';
comment on column N_WF_EXCEPTION.node_name
  is '节点名称';
comment on column N_WF_EXCEPTION.flow_name
  is '流程名称';
comment on column N_WF_EXCEPTION.biz_param
  is '业务参数';
comment on column N_WF_EXCEPTION.exception_info
  is '异常信息';
comment on column N_WF_EXCEPTION.exception_time
  is '异常时间';
comment on column N_WF_EXCEPTION.user_id
  is '提交人';
comment on column N_WF_EXCEPTION.user_name
  is '提交人姓名';
comment on column N_WF_EXCEPTION.biz_id
  is '业务流水号';
comment on column N_WF_EXCEPTION.biz_type
  is '业务申请类型';
comment on column N_WF_EXCEPTION.op_type
  is '操作类型【提交、退回等】';
alter table N_WF_EXCEPTION
  add constraint N_WF_EXCEPTIONPK_ primary key (PK_ID);


create table N_WF_FLOW
(
  flow_id      NUMBER(10) not null,
  system_id    VARCHAR2(32),
  flow_state   VARCHAR2(5),
  flow_content CLOB,
  start_time   VARCHAR2(32),
  flow_sign    NUMBER(10) not null,
  flow_name    VARCHAR2(100),
  flow_admin   VARCHAR2(32),
  org_id       VARCHAR2(32)
)
;
comment on table N_WF_FLOW
  is '流程图信息';
comment on column N_WF_FLOW.flow_id
  is '流程标识';
comment on column N_WF_FLOW.system_id
  is '系统id';
comment on column N_WF_FLOW.flow_state
  is '流程图状态';
comment on column N_WF_FLOW.flow_content
  is '流程图内容';
comment on column N_WF_FLOW.start_time
  is '创建时间';
comment on column N_WF_FLOW.flow_sign
  is '流程标识';
comment on column N_WF_FLOW.flow_name
  is '流程名称';
comment on column N_WF_FLOW.flow_admin
  is '流程图管理员';
comment on column N_WF_FLOW.org_id
  is '管理员机构id';
alter table N_WF_FLOW
  add constraint PK_N_WF_FLOW primary key (FLOW_ID, FLOW_SIGN);


create table N_WF_INSTANCE
(
  instance_id       VARCHAR2(32) not null,
  flow_name         VARCHAR2(32),
  flow_id           VARCHAR2(32),
  flow_admin        VARCHAR2(32),
  flow_starter      VARCHAR2(32),
  start_time        VARCHAR2(32),
  system_id         VARCHAR2(32),
  org_id            VARCHAR2(32),
  flow_state        VARCHAR2(5),
  biz_id            VARCHAR2(32),
  biz_user_name     VARCHAR2(32),
  biz_user_id       VARCHAR2(32),
  flow_param        VARCHAR2(500),
  biz_type          VARCHAR2(32),
  flow_starter_name VARCHAR2(32),
  main_instance_id  VARCHAR2(32),
  biz_param1        VARCHAR2(32),
  biz_param2        VARCHAR2(32),
  biz_param3        VARCHAR2(32),
  biz_param4        VARCHAR2(32),
  biz_param5        VARCHAR2(32)
)
;
comment on table N_WF_INSTANCE
  is '流程实例表';
comment on column N_WF_INSTANCE.instance_id
  is '流程实例id';
comment on column N_WF_INSTANCE.flow_name
  is '流程名称';
comment on column N_WF_INSTANCE.flow_id
  is '流程id';
comment on column N_WF_INSTANCE.flow_admin
  is '流程管理员';
comment on column N_WF_INSTANCE.flow_starter
  is '流程发起者';
comment on column N_WF_INSTANCE.start_time
  is '流程发起时间';
comment on column N_WF_INSTANCE.system_id
  is '系统id';
comment on column N_WF_INSTANCE.org_id
  is '发起人机构id';
comment on column N_WF_INSTANCE.flow_state
  is '流程状态';
comment on column N_WF_INSTANCE.biz_id
  is '业务流水号';
comment on column N_WF_INSTANCE.biz_user_name
  is '客户名称';
comment on column N_WF_INSTANCE.biz_user_id
  is '客户id';
comment on column N_WF_INSTANCE.flow_param
  is '流程参数';
comment on column N_WF_INSTANCE.biz_type
  is '业务类型';
comment on column N_WF_INSTANCE.flow_starter_name
  is '发起者名称';
comment on column N_WF_INSTANCE.main_instance_id
  is '主流程id';
comment on column N_WF_INSTANCE.biz_param1
  is '扩展参数1';
comment on column N_WF_INSTANCE.biz_param2
  is '扩展参数2';
comment on column N_WF_INSTANCE.biz_param3
  is '扩展参数3';
comment on column N_WF_INSTANCE.biz_param4
  is '扩展参数4';
comment on column N_WF_INSTANCE.biz_param5
  is '扩展参数5';
alter table N_WF_INSTANCE
  add constraint PK_INSTANCE_ID primary key (INSTANCE_ID);


create table N_WF_INSTANCE_HIS
(
  instance_id       VARCHAR2(32) not null,
  flow_name         VARCHAR2(32),
  flow_id           VARCHAR2(32),
  flow_admin        VARCHAR2(32),
  flow_starter      VARCHAR2(32),
  start_time        VARCHAR2(32),
  system_id         VARCHAR2(32),
  org_id            VARCHAR2(32),
  flow_state        VARCHAR2(5),
  biz_id            VARCHAR2(32),
  biz_user_name     VARCHAR2(32),
  biz_user_id       VARCHAR2(32),
  flow_param        VARCHAR2(500),
  biz_type          VARCHAR2(32),
  end_time          VARCHAR2(32),
  flow_starter_name VARCHAR2(32),
  main_instance_id  VARCHAR2(32),
  biz_param1        VARCHAR2(32),
  biz_param2        VARCHAR2(32),
  biz_param3        VARCHAR2(32),
  biz_param4        VARCHAR2(32),
  biz_param5        VARCHAR2(32)
)
;
comment on table N_WF_INSTANCE_HIS
  is '流程实例历史表';
comment on column N_WF_INSTANCE_HIS.instance_id
  is '流程实例id';
comment on column N_WF_INSTANCE_HIS.flow_name
  is '流程名称';
comment on column N_WF_INSTANCE_HIS.flow_id
  is '流程id';
comment on column N_WF_INSTANCE_HIS.flow_admin
  is '流程管理员';
comment on column N_WF_INSTANCE_HIS.flow_starter
  is '流程发起者';
comment on column N_WF_INSTANCE_HIS.start_time
  is '流程发起时间';
comment on column N_WF_INSTANCE_HIS.system_id
  is '系统id';
comment on column N_WF_INSTANCE_HIS.org_id
  is '发起人机构id';
comment on column N_WF_INSTANCE_HIS.flow_state
  is '流程状态';
comment on column N_WF_INSTANCE_HIS.biz_id
  is '业务流水号';
comment on column N_WF_INSTANCE_HIS.biz_user_name
  is '客户名称';
comment on column N_WF_INSTANCE_HIS.biz_user_id
  is '客户id';
comment on column N_WF_INSTANCE_HIS.flow_param
  is '流程参数';
comment on column N_WF_INSTANCE_HIS.biz_type
  is '业务类型';
comment on column N_WF_INSTANCE_HIS.end_time
  is '流程结束时间';
comment on column N_WF_INSTANCE_HIS.flow_starter_name
  is '发起者姓名';
comment on column N_WF_INSTANCE_HIS.main_instance_id
  is '主流程id';
comment on column N_WF_INSTANCE_HIS.biz_param1
  is '业务扩展参数1';
comment on column N_WF_INSTANCE_HIS.biz_param2
  is '业务扩展参数2';
comment on column N_WF_INSTANCE_HIS.biz_param3
  is '业务扩展参数3';
comment on column N_WF_INSTANCE_HIS.biz_param4
  is '业务扩展参数4';
comment on column N_WF_INSTANCE_HIS.biz_param5
  is '业务扩展参数5';
alter table N_WF_INSTANCE_HIS
  add constraint PK_N_WF_INSTANCE_HIS primary key (INSTANCE_ID);


create table N_WF_INSTANCE_SUB
(
  instance_id      VARCHAR2(32),
  biz_type         VARCHAR2(32) not null,
  main_instance_id VARCHAR2(32) not null,
  start_time       VARCHAR2(32),
  sub_flow_starter VARCHAR2(32),
  start_node_id    VARCHAR2(32) not null
)
;
comment on table N_WF_INSTANCE_SUB
  is '子流程发起记录';
comment on column N_WF_INSTANCE_SUB.instance_id
  is '流程实例id';
comment on column N_WF_INSTANCE_SUB.biz_type
  is '业务类型';
comment on column N_WF_INSTANCE_SUB.main_instance_id
  is '主流程id';
comment on column N_WF_INSTANCE_SUB.start_time
  is '子流程流程发起时间';
comment on column N_WF_INSTANCE_SUB.sub_flow_starter
  is '子流程发起人';
comment on column N_WF_INSTANCE_SUB.start_node_id
  is '发起节点';
alter table N_WF_INSTANCE_SUB
  add constraint PK_N_WF_INSTANCE_SUB primary key (MAIN_INSTANCE_ID, BIZ_TYPE, START_NODE_ID);


create table N_WF_METTING
(
  flow_name   VARCHAR2(100),
  instance_id VARCHAR2(32) not null,
  user_id     VARCHAR2(32),
  biz_id      VARCHAR2(32),
  metting_sts VARCHAR2(2),
  start_time  VARCHAR2(32),
  biz_page    VARCHAR2(50),
  node_id     VARCHAR2(32)
)
;
comment on table N_WF_METTING
  is '会办表';
comment on column N_WF_METTING.flow_name
  is '流程名称';
comment on column N_WF_METTING.instance_id
  is '实例ID';
comment on column N_WF_METTING.user_id
  is '会议秘书';
comment on column N_WF_METTING.biz_id
  is '业务流水号';
comment on column N_WF_METTING.metting_sts
  is '会议状态';
comment on column N_WF_METTING.start_time
  is '开始时间';
comment on column N_WF_METTING.biz_page
  is '业务页面';
comment on column N_WF_METTING.node_id
  is '节点id';
alter table N_WF_METTING
  add constraint PK_N_WF_METTING primary key (INSTANCE_ID);


create table N_WF_METTING_HIS
(
  instance_id     VARCHAR2(32) not null,
  biz_id          VARCHAR2(32),
  start_time      VARCHAR2(32),
  end_time        VARCHAR2(32),
  metting_sub     VARCHAR2(50),
  metting_year    VARCHAR2(32),
  metting_no      VARCHAR2(4),
  metting_comment VARCHAR2(200),
  metting_sts     VARCHAR2(4),
  user_id         VARCHAR2(32) not null,
  user_name       VARCHAR2(32),
  biz_page        VARCHAR2(50),
  node_id         VARCHAR2(32)
)
;
comment on table N_WF_METTING_HIS
  is '会办历史';
comment on column N_WF_METTING_HIS.instance_id
  is '实例id';
comment on column N_WF_METTING_HIS.biz_id
  is '业务主键';
comment on column N_WF_METTING_HIS.start_time
  is '开始时间';
comment on column N_WF_METTING_HIS.end_time
  is '结束时间';
comment on column N_WF_METTING_HIS.metting_sub
  is '会议主题';
comment on column N_WF_METTING_HIS.metting_year
  is '年份';
comment on column N_WF_METTING_HIS.metting_no
  is '期数';
comment on column N_WF_METTING_HIS.metting_comment
  is '意见';
comment on column N_WF_METTING_HIS.metting_sts
  is '结论';
comment on column N_WF_METTING_HIS.user_id
  is '参会人';
comment on column N_WF_METTING_HIS.user_name
  is '参会人姓名';
comment on column N_WF_METTING_HIS.biz_page
  is '业务页面';
comment on column N_WF_METTING_HIS.node_id
  is '节点id';
alter table N_WF_METTING_HIS
  add constraint N_WF_METTING_HISPK_ primary key (INSTANCE_ID, USER_ID);


create table N_WF_NODE
(
  instance_id    VARCHAR2(32) not null,
  node_id        VARCHAR2(10) not null,
  node_sign      VARCHAR2(32),
  node_name      VARCHAR2(32),
  node_state     VARCHAR2(5),
  start_time     VARCHAR2(32),
  org_id         VARCHAR2(32),
  last_node_id   VARCHAR2(10),
  last_node_name VARCHAR2(32),
  node_type      VARCHAR2(5),
  next_node_id   VARCHAR2(10),
  next_user_id   VARCHAR2(32)
)
;
comment on table N_WF_NODE
  is '节点流转表';
comment on column N_WF_NODE.instance_id
  is '实例id';
comment on column N_WF_NODE.node_id
  is '节点id';
comment on column N_WF_NODE.node_sign
  is '节点标识';
comment on column N_WF_NODE.node_name
  is '节点名称';
comment on column N_WF_NODE.node_state
  is '节点状态';
comment on column N_WF_NODE.start_time
  is '节点开始时间';
comment on column N_WF_NODE.org_id
  is '提交人机构id';
comment on column N_WF_NODE.last_node_id
  is '上一节点id';
comment on column N_WF_NODE.last_node_name
  is '上一节点名称';
comment on column N_WF_NODE.node_type
  is '节点类型';
comment on column N_WF_NODE.next_node_id
  is '下一节点id';
comment on column N_WF_NODE.next_user_id
  is '下一节点处理人';
alter table N_WF_NODE
  add constraint PK_N_WF_NODE primary key (INSTANCE_ID, NODE_ID);


create table N_WF_NODE_DONE
(
  instance_id    VARCHAR2(32) not null,
  node_id        VARCHAR2(10) not null,
  node_sign      VARCHAR2(32),
  node_name      VARCHAR2(32),
  node_state     VARCHAR2(5),
  start_time     VARCHAR2(32),
  end_time       VARCHAR2(32),
  org_id         VARCHAR2(32),
  last_node_id   VARCHAR2(10),
  last_node_name VARCHAR2(32),
  node_type      VARCHAR2(5),
  next_node_id   VARCHAR2(10),
  next_user_id   VARCHAR2(32)
)
;
comment on table N_WF_NODE_DONE
  is '节点流转表';
comment on column N_WF_NODE_DONE.instance_id
  is '实例id';
comment on column N_WF_NODE_DONE.node_id
  is '节点id';
comment on column N_WF_NODE_DONE.node_sign
  is '节点标识';
comment on column N_WF_NODE_DONE.node_name
  is '节点名称';
comment on column N_WF_NODE_DONE.node_state
  is '节点状态';
comment on column N_WF_NODE_DONE.start_time
  is '节点开始时间';
comment on column N_WF_NODE_DONE.end_time
  is '结束时间';
comment on column N_WF_NODE_DONE.org_id
  is '提交人机构id';
comment on column N_WF_NODE_DONE.last_node_id
  is '上一节点id';
comment on column N_WF_NODE_DONE.last_node_name
  is '上一节点名称';
comment on column N_WF_NODE_DONE.node_type
  is '节点类型';
comment on column N_WF_NODE_DONE.next_node_id
  is '下一节点ID';
comment on column N_WF_NODE_DONE.next_user_id
  is '下一节点处理人';
alter table N_WF_NODE_DONE
  add constraint PK_N_WF_NODE_DONE primary key (INSTANCE_ID, NODE_ID);


create table N_WF_NODE_HIS
(
  instance_id    VARCHAR2(32) not null,
  node_id        VARCHAR2(10) not null,
  node_sign      VARCHAR2(32),
  node_name      VARCHAR2(32),
  node_state     VARCHAR2(5),
  start_time     VARCHAR2(32),
  end_time       VARCHAR2(32),
  org_id         VARCHAR2(32),
  last_node_id   VARCHAR2(10),
  last_node_name VARCHAR2(32),
  node_type      VARCHAR2(5),
  next_node_id   VARCHAR2(10),
  next_user_id   VARCHAR2(32)
)
;
comment on table N_WF_NODE_HIS
  is '节点流转表';
comment on column N_WF_NODE_HIS.instance_id
  is '实例id';
comment on column N_WF_NODE_HIS.node_id
  is '节点id';
comment on column N_WF_NODE_HIS.node_sign
  is '节点标识';
comment on column N_WF_NODE_HIS.node_name
  is '节点名称';
comment on column N_WF_NODE_HIS.node_state
  is '节点状态';
comment on column N_WF_NODE_HIS.start_time
  is '节点开始时间';
comment on column N_WF_NODE_HIS.end_time
  is '结束时间';
comment on column N_WF_NODE_HIS.org_id
  is '提交人机构id';
comment on column N_WF_NODE_HIS.last_node_id
  is '上一节点id';
comment on column N_WF_NODE_HIS.last_node_name
  is '上一节点名称';
comment on column N_WF_NODE_HIS.node_type
  is '节点类型';
comment on column N_WF_NODE_HIS.next_node_id
  is '下一节点id';
comment on column N_WF_NODE_HIS.next_user_id
  is '下一节点处理人';
alter table N_WF_NODE_HIS
  add constraint PK_N_WF_NODE_HIS primary key (INSTANCE_ID, NODE_ID);


create table N_WF_TASKPOOL
(
  pool_id   VARCHAR2(32) not null,
  pool_name VARCHAR2(32),
  pool_desc VARCHAR2(32),
  org_id    VARCHAR2(32),
  system_id VARCHAR2(32)
)
;
comment on table N_WF_TASKPOOL
  is '项目池';
comment on column N_WF_TASKPOOL.pool_id
  is '项目池id';
comment on column N_WF_TASKPOOL.pool_name
  is '项目池名称';
comment on column N_WF_TASKPOOL.pool_desc
  is '项目池描述';
comment on column N_WF_TASKPOOL.org_id
  is '机构ID';
comment on column N_WF_TASKPOOL.system_id
  is '系统id';
alter table N_WF_TASKPOOL
  add constraint PK_N_WF_TASKPOOL primary key (POOL_ID);


create table N_WF_TASKPOOL_CONFIG
(
  pool_id   VARCHAR2(32) not null,
  pool_type VARCHAR2(32) not null,
  code      VARCHAR2(32) not null
)
;
comment on table N_WF_TASKPOOL_CONFIG
  is '项目池关联配置';
comment on column N_WF_TASKPOOL_CONFIG.pool_id
  is '项目池id';
comment on column N_WF_TASKPOOL_CONFIG.pool_type
  is '关联类型';
comment on column N_WF_TASKPOOL_CONFIG.code
  is '关系码';
alter table N_WF_TASKPOOL_CONFIG
  add constraint PK_N_WF_TASKPOOL_CONFIG primary key (POOL_ID, POOL_TYPE, CODE);


create table N_WF_USER_DONE
(
  instance_id    VARCHAR2(32) not null,
  node_id        VARCHAR2(10) not null,
  user_id        VARCHAR2(32) not null,
  start_time     VARCHAR2(32),
  end_time       VARCHAR2(32),
  user_name      VARCHAR2(32),
  last_user_id   VARCHAR2(32),
  last_user_name VARCHAR2(32),
  sign_in        VARCHAR2(2) default 0,
  user_level     NUMBER(5) default 0
)
;
comment on table N_WF_USER_DONE
  is '用户办结表';
comment on column N_WF_USER_DONE.instance_id
  is '实例id';
comment on column N_WF_USER_DONE.node_id
  is '节点id';
comment on column N_WF_USER_DONE.user_id
  is '用户id';
comment on column N_WF_USER_DONE.start_time
  is '开始时间';
comment on column N_WF_USER_DONE.end_time
  is '结束时间';
comment on column N_WF_USER_DONE.user_name
  is '用户姓名';
comment on column N_WF_USER_DONE.last_user_id
  is '上一节点处理人';
comment on column N_WF_USER_DONE.last_user_name
  is '上一节点处理人姓名';
comment on column N_WF_USER_DONE.sign_in
  is '1-已签收，0-未签收';
comment on column N_WF_USER_DONE.user_level
  is '用户顺序，越小越靠前';
alter table N_WF_USER_DONE
  add constraint PK_N_WF_USER_DONE primary key (INSTANCE_ID, NODE_ID, USER_ID);


create table N_WF_USER_HIS
(
  instance_id    VARCHAR2(32) not null,
  node_id        VARCHAR2(10) not null,
  user_id        VARCHAR2(32) not null,
  start_time     VARCHAR2(32),
  end_time       VARCHAR2(32),
  user_name      VARCHAR2(32),
  last_user_id   VARCHAR2(32),
  last_user_name VARCHAR2(32),
  sign_in        VARCHAR2(2) default 0,
  user_level     NUMBER(5) default 0
)
;
comment on table N_WF_USER_HIS
  is '用户历史表';
comment on column N_WF_USER_HIS.instance_id
  is '实例id';
comment on column N_WF_USER_HIS.node_id
  is '节点id';
comment on column N_WF_USER_HIS.user_id
  is '用户id';
comment on column N_WF_USER_HIS.start_time
  is '开始时间';
comment on column N_WF_USER_HIS.end_time
  is '结束时间';
comment on column N_WF_USER_HIS.user_name
  is '用户姓名';
comment on column N_WF_USER_HIS.last_user_id
  is '上一节点处理人';
comment on column N_WF_USER_HIS.last_user_name
  is '上一节点处理人姓名';
comment on column N_WF_USER_HIS.sign_in
  is '1-已签收，0-未签收';
comment on column N_WF_USER_HIS.user_level
  is '用户顺序，越小越靠前';
alter table N_WF_USER_HIS
  add constraint PK_N_WF_USER_HIS primary key (INSTANCE_ID, NODE_ID, USER_ID);


create table N_WF_USER_TODO
(
  instance_id    VARCHAR2(32) not null,
  node_id        VARCHAR2(10) not null,
  user_id        VARCHAR2(32) not null,
  start_time     VARCHAR2(32),
  user_name      VARCHAR2(32),
  last_user_id   VARCHAR2(32),
  last_user_name VARCHAR2(32),
  sign_in        VARCHAR2(2) default 0,
  user_level     NUMBER(5) default 0
)
;
comment on table N_WF_USER_TODO
  is '用户待办表';
comment on column N_WF_USER_TODO.instance_id
  is '实例id';
comment on column N_WF_USER_TODO.node_id
  is '节点id';
comment on column N_WF_USER_TODO.user_id
  is '用户id';
comment on column N_WF_USER_TODO.start_time
  is '开始时间';
comment on column N_WF_USER_TODO.user_name
  is '用户姓名';
comment on column N_WF_USER_TODO.last_user_id
  is '上一节点处理人';
comment on column N_WF_USER_TODO.last_user_name
  is '上一节点处理人姓名';
comment on column N_WF_USER_TODO.sign_in
  is '1-已签收，0-未签收';
comment on column N_WF_USER_TODO.user_level
  is '用户顺序，越小越靠前';
create index PKU_N_WF_USER_TODO on N_WF_USER_TODO (USER_ID);
alter table N_WF_USER_TODO
  add constraint PK_N_WF_USER_TODO primary key (INSTANCE_ID, NODE_ID, USER_ID);



create table ADMIN_QRTZ_BLOB_TRIGGERS
(
  SCHED_NAME    VARCHAR2(120) not null,
  TRIGGER_NAME  VARCHAR2(200) not null,
  TRIGGER_GROUP VARCHAR2(200) not null,
  BLOB_DATA     BLOB
)
;
alter table ADMIN_QRTZ_BLOB_TRIGGERS
  add primary key (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP);
create table ADMIN_QRTZ_CALENDARS
(
  SCHED_NAME    VARCHAR2(120) not null,
  CALENDAR_NAME VARCHAR2(200) not null,
  CALENDAR      BLOB not null
)
;
alter table ADMIN_QRTZ_CALENDARS
  add primary key (SCHED_NAME, CALENDAR_NAME);

create table ADMIN_QRTZ_CRON_TRIGGERS
(
  SCHED_NAME      VARCHAR2(120) not null,
  TRIGGER_NAME    VARCHAR2(200) not null,
  TRIGGER_GROUP   VARCHAR2(200) not null,
  CRON_EXPRESSION VARCHAR2(200) not null,
  TIME_ZONE_ID    VARCHAR2(80)
)
;
alter table ADMIN_QRTZ_CRON_TRIGGERS
  add primary key (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP);


create table ADMIN_QRTZ_FIRED_TRIGGERS
(
  SCHED_NAME        VARCHAR2(120) not null,
  ENTRY_ID          VARCHAR2(95) not null,
  TRIGGER_NAME      VARCHAR2(200) not null,
  TRIGGER_GROUP     VARCHAR2(200) not null,
  INSTANCE_NAME     VARCHAR2(200) not null,
  FIRED_TIME        NUMBER(13) not null,
  SCHED_TIME        NUMBER(13) not null,
  PRIORITY          NUMBER not null,
  STATE             VARCHAR2(16) not null,
  JOB_NAME          VARCHAR2(200),
  JOB_GROUP         VARCHAR2(200),
  IS_NONCONCURRENT  VARCHAR2(1),
  REQUESTS_RECOVERY VARCHAR2(1)
)
;
alter table ADMIN_QRTZ_FIRED_TRIGGERS
  add primary key (SCHED_NAME, ENTRY_ID);


create table ADMIN_QRTZ_JOB_DETAILS
(
  SCHED_NAME        VARCHAR2(120) not null,
  JOB_NAME          VARCHAR2(200) not null,
  JOB_GROUP         VARCHAR2(200) not null,
  DESCRIPTION       VARCHAR2(250),
  JOB_CLASS_NAME    VARCHAR2(250) not null,
  IS_DURABLE        VARCHAR2(1) not null,
  IS_NONCONCURRENT  VARCHAR2(1) not null,
  IS_UPDATE_DATA    VARCHAR2(1) not null,
  REQUESTS_RECOVERY VARCHAR2(1) not null,
  JOB_DATA          BLOB
)
;
alter table ADMIN_QRTZ_JOB_DETAILS
  add primary key (SCHED_NAME, JOB_NAME, JOB_GROUP);


create table ADMIN_QRTZ_LOCKS
(
  SCHED_NAME VARCHAR2(120) not null,
  LOCK_NAME  VARCHAR2(40) not null
)
;
alter table ADMIN_QRTZ_LOCKS
  add primary key (SCHED_NAME, LOCK_NAME);


create table ADMIN_QRTZ_PAUSED_TRIGGER_GRPS
(
  SCHED_NAME    VARCHAR2(120) not null,
  TRIGGER_GROUP VARCHAR2(200) not null
)
;
alter table ADMIN_QRTZ_PAUSED_TRIGGER_GRPS
  add primary key (SCHED_NAME, TRIGGER_GROUP);


create table ADMIN_QRTZ_SCHEDULER_STATE
(
  SCHED_NAME        VARCHAR2(120) not null,
  INSTANCE_NAME     VARCHAR2(200) not null,
  LAST_CHECKIN_TIME NUMBER(13) not null,
  CHECKIN_INTERVAL  NUMBER(13) not null
)
;
alter table ADMIN_QRTZ_SCHEDULER_STATE
  add primary key (SCHED_NAME, INSTANCE_NAME);


create table ADMIN_QRTZ_TRIGGERS
(
  SCHED_NAME     VARCHAR2(120) not null,
  TRIGGER_NAME   VARCHAR2(200) not null,
  TRIGGER_GROUP  VARCHAR2(200) not null,
  JOB_NAME       VARCHAR2(200) not null,
  JOB_GROUP      VARCHAR2(200) not null,
  DESCRIPTION    VARCHAR2(250),
  NEXT_FIRE_TIME NUMBER(13),
  PREV_FIRE_TIME NUMBER(13),
  PRIORITY       NUMBER,
  TRIGGER_STATE  VARCHAR2(16) not null,
  TRIGGER_TYPE   VARCHAR2(8) not null,
  START_TIME     NUMBER(13) not null,
  END_TIME       NUMBER(13),
  CALENDAR_NAME  VARCHAR2(200),
  MISFIRE_INSTR  NUMBER(2),
  JOB_DATA       BLOB
)
;
alter table ADMIN_QRTZ_TRIGGERS
  add primary key (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP);
alter table ADMIN_QRTZ_TRIGGERS
  add foreign key (SCHED_NAME, JOB_NAME, JOB_GROUP)
  references ADMIN_QRTZ_JOB_DETAILS (SCHED_NAME, JOB_NAME, JOB_GROUP);


create table ADMIN_QRTZ_SIMPLE_TRIGGERS
(
  SCHED_NAME      VARCHAR2(120) not null,
  TRIGGER_NAME    VARCHAR2(200) not null,
  TRIGGER_GROUP   VARCHAR2(200) not null,
  REPEAT_COUNT    NUMBER(7) not null,
  REPEAT_INTERVAL NUMBER(12) not null,
  TIMES_TRIGGERED NUMBER(10) not null
)
;
alter table ADMIN_QRTZ_SIMPLE_TRIGGERS
  add primary key (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP);
alter table ADMIN_QRTZ_SIMPLE_TRIGGERS
  add foreign key (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP)
  references ADMIN_QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP);


create table ADMIN_QRTZ_SIMPROP_TRIGGERS
(
  SCHED_NAME    VARCHAR2(120) not null,
  TRIGGER_NAME  VARCHAR2(200) not null,
  TRIGGER_GROUP VARCHAR2(200) not null,
  STR_PROP_1    VARCHAR2(512),
  STR_PROP_2    VARCHAR2(512),
  STR_PROP_3    VARCHAR2(512),
  NUMBER_PROP_1 NUMBER,
  NUMBER_PROP_2 NUMBER,
  LONG_PROP_1   NUMBER,
  LONG_PROP_2   NUMBER,
  DEC_PROP_1    NUMBER(13,4),
  DEC_PROP_2    NUMBER(13,4),
  BOOL_PROP_1   VARCHAR2(1),
  BOOL_PROP_2   VARCHAR2(1)
)
;
alter table ADMIN_QRTZ_SIMPROP_TRIGGERS
  add primary key (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP);


create table ADMIN_QRTZ_TRIGGERS2
(
  SCHED_NAME     VARCHAR2(120) not null,
  TRIGGER_NAME   VARCHAR2(200) not null,
  TRIGGER_GROUP  VARCHAR2(200) not null,
  JOB_NAME       VARCHAR2(200) not null,
  JOB_GROUP      VARCHAR2(200) not null,
  DESCRIPTION    VARCHAR2(250),
  NEXT_FIRE_TIME NUMBER(13),
  PREV_FIRE_TIME NUMBER(13),
  PRIORITY       NUMBER,
  TRIGGER_STATE  VARCHAR2(16) not null,
  TRIGGER_TYPE   VARCHAR2(8) not null,
  START_TIME     NUMBER(13) not null,
  END_TIME       NUMBER(13),
  CALENDAR_NAME  VARCHAR2(200),
  MISFIRE_INSTR  NUMBER(2),
  JOB_DATA       BLOB
)
;

create table ADMIN_QRTZ_TRIGGER_GROUP
(
  ID           VARCHAR2(32) not null,
  APP_NAME     VARCHAR2(64) not null,
  TITLE        VARCHAR2(100) not null,
  ORDER_CODE   NUMBER(4) default '0',
  ADDRESS_TYPE NVARCHAR2(1) default 0,
  ADDRESS_LIST VARCHAR2(512)
)
;
comment on column ADMIN_QRTZ_TRIGGER_GROUP.APP_NAME
  is '执行器AppName';
comment on column ADMIN_QRTZ_TRIGGER_GROUP.TITLE
  is '执行器名称';
comment on column ADMIN_QRTZ_TRIGGER_GROUP.ORDER_CODE
  is '排序';
comment on column ADMIN_QRTZ_TRIGGER_GROUP.ADDRESS_TYPE
  is '执行器地址类型：0=自动注册、1=手动录入';
comment on column ADMIN_QRTZ_TRIGGER_GROUP.ADDRESS_LIST
  is '执行器地址列表，多地址逗号分隔';
alter table ADMIN_QRTZ_TRIGGER_GROUP
  add primary key (ID);
alter table ADMIN_QRTZ_TRIGGER_GROUP
  add unique (APP_NAME);


create table ADMIN_QRTZ_TRIGGER_INFO
(
  ID                      VARCHAR2(32) not null,
  JOB_GROUP               VARCHAR2(32) not null,
  JOB_CRON                VARCHAR2(128) not null,
  JOB_DESC                VARCHAR2(255) not null,
  ADD_TIME                DATE,
  UPDATE_TIME             DATE,
  AUTHOR                  VARCHAR2(64),
  ALARM_EMAIL             VARCHAR2(255),
  EXECUTOR_ROUTE_STRATEGY VARCHAR2(50),
  EXECUTOR_HANDLER        VARCHAR2(255),
  EXECUTOR_PARAM          VARCHAR2(2000),
  EXECUTOR_BLOCK_STRATEGY VARCHAR2(50),
  EXECUTOR_FAIL_STRATEGY  VARCHAR2(50),
  GLUE_TYPE               VARCHAR2(50) not null,
  GLUE_SOURCE             VARCHAR2(2000),
  GLUE_REMARK             VARCHAR2(128),
  GLUE_UPDATETIME         DATE,
  CHILD_JOBID             VARCHAR2(3200)
)
;
comment on column ADMIN_QRTZ_TRIGGER_INFO.JOB_GROUP
  is '执行器主键ID';
comment on column ADMIN_QRTZ_TRIGGER_INFO.JOB_CRON
  is '任务执行CRON';
comment on column ADMIN_QRTZ_TRIGGER_INFO.JOB_DESC
  is 'JOB描述';
comment on column ADMIN_QRTZ_TRIGGER_INFO.ADD_TIME
  is '添加时间';
comment on column ADMIN_QRTZ_TRIGGER_INFO.UPDATE_TIME
  is '修改时间';
comment on column ADMIN_QRTZ_TRIGGER_INFO.AUTHOR
  is '作者';
comment on column ADMIN_QRTZ_TRIGGER_INFO.ALARM_EMAIL
  is '报警邮件';
comment on column ADMIN_QRTZ_TRIGGER_INFO.EXECUTOR_ROUTE_STRATEGY
  is '执行器路由策略';
comment on column ADMIN_QRTZ_TRIGGER_INFO.EXECUTOR_HANDLER
  is '执行器任务handler';
comment on column ADMIN_QRTZ_TRIGGER_INFO.EXECUTOR_PARAM
  is '执行器任务参数';
comment on column ADMIN_QRTZ_TRIGGER_INFO.EXECUTOR_BLOCK_STRATEGY
  is '阻塞处理策略';
comment on column ADMIN_QRTZ_TRIGGER_INFO.EXECUTOR_FAIL_STRATEGY
  is '失败处理策略';
comment on column ADMIN_QRTZ_TRIGGER_INFO.GLUE_TYPE
  is 'GLUE类型';
comment on column ADMIN_QRTZ_TRIGGER_INFO.GLUE_SOURCE
  is 'GLUE源代码';
comment on column ADMIN_QRTZ_TRIGGER_INFO.GLUE_REMARK
  is 'GLUE备注';
comment on column ADMIN_QRTZ_TRIGGER_INFO.GLUE_UPDATETIME
  is 'GLUE更新时间';
comment on column ADMIN_QRTZ_TRIGGER_INFO.CHILD_JOBID
  is '子任务ID，多个逗号分隔';
alter table ADMIN_QRTZ_TRIGGER_INFO
  add primary key (ID);


create table ADMIN_QRTZ_TRIGGER_LOG
(
  ID               VARCHAR2(32) not null,
  JOB_GROUP        VARCHAR2(32) not null,
  JOB_ID           VARCHAR2(32) not null,
  GLUE_TYPE        VARCHAR2(50),
  EXECUTOR_ADDRESS VARCHAR2(255),
  EXECUTOR_HANDLER VARCHAR2(255),
  EXECUTOR_PARAM   VARCHAR2(2000),
  TRIGGER_TIME     DATE,
  TRIGGER_CODE     VARCHAR2(255) default '0',
  TRIGGER_MSG      VARCHAR2(2048),
  HANDLE_TIME      DATE,
  HANDLE_CODE      VARCHAR2(255) default '0',
  HANDLE_MSG       VARCHAR2(2048)
)
;
comment on table ADMIN_QRTZ_TRIGGER_LOG
  is '执行记录表';
comment on column ADMIN_QRTZ_TRIGGER_LOG.ID
  is 'ID';
comment on column ADMIN_QRTZ_TRIGGER_LOG.JOB_GROUP
  is '执行器主键ID';
comment on column ADMIN_QRTZ_TRIGGER_LOG.JOB_ID
  is '任务，主键ID';
comment on column ADMIN_QRTZ_TRIGGER_LOG.GLUE_TYPE
  is 'GLUE类型';
comment on column ADMIN_QRTZ_TRIGGER_LOG.EXECUTOR_ADDRESS
  is '执行器地址，本次执行的地址';
comment on column ADMIN_QRTZ_TRIGGER_LOG.EXECUTOR_HANDLER
  is '执行器任务handler';
comment on column ADMIN_QRTZ_TRIGGER_LOG.EXECUTOR_PARAM
  is '执行器任务参数';
comment on column ADMIN_QRTZ_TRIGGER_LOG.TRIGGER_TIME
  is '调度-时间';
comment on column ADMIN_QRTZ_TRIGGER_LOG.TRIGGER_CODE
  is '调度-结果';
comment on column ADMIN_QRTZ_TRIGGER_LOG.TRIGGER_MSG
  is '调度-日志';
comment on column ADMIN_QRTZ_TRIGGER_LOG.HANDLE_TIME
  is '执行-时间';
comment on column ADMIN_QRTZ_TRIGGER_LOG.HANDLE_CODE
  is '执行-状态';
comment on column ADMIN_QRTZ_TRIGGER_LOG.HANDLE_MSG
  is '执行-日志';
alter table ADMIN_QRTZ_TRIGGER_LOG
  add primary key (ID);

create table ADMIN_QRTZ_TRIGGER_LOGGLUE
(
  ID          VARCHAR2(32) not null,
  JOB_ID      VARCHAR2(32) not null,
  GLUE_TYPE   VARCHAR2(50),
  GLUE_SOURCE CLOB,
  GLUE_REMARK VARCHAR2(128) not null,
  ADD_TIME    DATE,
  UPDATE_TIME DATE
)
;
comment on column ADMIN_QRTZ_TRIGGER_LOGGLUE.JOB_ID
  is '任务ID';
comment on column ADMIN_QRTZ_TRIGGER_LOGGLUE.GLUE_TYPE
  is 'GLUE类型';
comment on column ADMIN_QRTZ_TRIGGER_LOGGLUE.GLUE_SOURCE
  is 'GLUE源代码';
comment on column ADMIN_QRTZ_TRIGGER_LOGGLUE.GLUE_REMARK
  is 'GLUE备注';
alter table ADMIN_QRTZ_TRIGGER_LOGGLUE
  add primary key (ID);

create table ADMIN_QRTZ_TRIGGER_REGISTRY
(
  ID             VARCHAR2(32) not null,
  REGISTRY_GROUP VARCHAR2(255) not null,
  REGISTRY_KEY   VARCHAR2(255) not null,
  REGISTRY_VALUE VARCHAR2(255) not null,
  UPDATE_TIME    TIMESTAMP(6) default CURRENT_TIMESTAMP
)
;
comment on column ADMIN_QRTZ_TRIGGER_REGISTRY.REGISTRY_GROUP
  is '注册组';
comment on column ADMIN_QRTZ_TRIGGER_REGISTRY.REGISTRY_KEY
  is '应用名称';
comment on column ADMIN_QRTZ_TRIGGER_REGISTRY.REGISTRY_VALUE
  is 'IP端口';
alter table ADMIN_QRTZ_TRIGGER_REGISTRY
  add primary key (ID);

create table MESSAGE_CONTENT
(
  EVENT_NO     VARCHAR2(32) not null,
  MESSAGE_TYPE VARCHAR2(32) not null,
  CHANNEL_TYPE VARCHAR2(6) not null,
  CONTENT      CLOB not null,
  EMAIL_TITLE  VARCHAR2(200),
  SEND_NUM     NUMBER(2) not null,
  TIME_START   VARCHAR2(20),
  TIME_END     VARCHAR2(20)
)
;
comment on table MESSAGE_CONTENT
  is '消息发送具体内容表';
comment on column MESSAGE_CONTENT.EVENT_NO
  is '事件唯一编号';
comment on column MESSAGE_CONTENT.MESSAGE_TYPE
  is '消息类型';
comment on column MESSAGE_CONTENT.CHANNEL_TYPE
  is '适用渠道类型';
comment on column MESSAGE_CONTENT.CONTENT
  is '消息内容';
comment on column MESSAGE_CONTENT.EMAIL_TITLE
  is '邮件/系统消息标题';
comment on column MESSAGE_CONTENT.SEND_NUM
  is '异常重发次数';
comment on column MESSAGE_CONTENT.TIME_START
  is '发送开始时间';
comment on column MESSAGE_CONTENT.TIME_END
  is '发送结束时间';
create index INS_MESSAGE_CONTENT on MESSAGE_CONTENT (EVENT_NO, MESSAGE_TYPE, CHANNEL_TYPE);


create table MESSAGE_EVENT
(
  EVENT_NO       VARCHAR2(32) not null,
  TEMPLATE_PARAM CLOB,
  CREATE_TIME    VARCHAR2(20),
  MESSAGE_TYPE   VARCHAR2(32) not null
)
;
comment on table MESSAGE_EVENT
  is '消息事件表';
comment on column MESSAGE_EVENT.EVENT_NO
  is '事件唯一编号';
comment on column MESSAGE_EVENT.TEMPLATE_PARAM
  is '参数';
comment on column MESSAGE_EVENT.CREATE_TIME
  is '创建时间';
comment on column MESSAGE_EVENT.MESSAGE_TYPE
  is '消息类型';
alter table MESSAGE_EVENT
  add primary key (EVENT_NO);


create table MESSAGE_POOL
(
  PK_NO         VARCHAR2(32) not null,
  EVENT_NO      VARCHAR2(32) not null,
  CHANNEL_TYPE  VARCHAR2(6) not null,
  USER_NO       VARCHAR2(32) not null,
  CREATE_TIME   VARCHAR2(20) not null,
  SEND_TIME     VARCHAR2(20),
  MESSAGE_LEVEL VARCHAR2(1) not null,
  STATE         VARCHAR2(1),
  TIME_START    VARCHAR2(5),
  PK_HASH       NUMBER(11) not null,
  MESSAGE_TYPE  VARCHAR2(32) not null,
  TIME_END      VARCHAR2(5)
)
;
comment on table MESSAGE_POOL
  is '消息池表';
comment on column MESSAGE_POOL.PK_NO
  is '主键';
comment on column MESSAGE_POOL.EVENT_NO
  is '事件唯一编号';
comment on column MESSAGE_POOL.CHANNEL_TYPE
  is '适用渠道类型';
comment on column MESSAGE_POOL.USER_NO
  is '用户码';
comment on column MESSAGE_POOL.CREATE_TIME
  is '创建时间';
comment on column MESSAGE_POOL.SEND_TIME
  is '发送完成时间';
comment on column MESSAGE_POOL.MESSAGE_LEVEL
  is '消息等级[小先发]';
comment on column MESSAGE_POOL.STATE
  is '发送状态';
comment on column MESSAGE_POOL.TIME_START
  is '固定发送时间';
alter table MESSAGE_POOL
  add primary key (PK_NO);


create table MESSAGE_POOL_HIS
(
  PK_NO         VARCHAR2(32) not null,
  EVENT_NO      VARCHAR2(32) not null,
  CHANNEL_TYPE  VARCHAR2(6) not null,
  USER_NO       VARCHAR2(32) not null,
  CREATE_TIME   VARCHAR2(20) not null,
  SEND_TIME     VARCHAR2(20),
  MESSAGE_LEVEL VARCHAR2(1) not null,
  STATE         VARCHAR2(1),
  TIME_START    VARCHAR2(5),
  PK_HASH       NUMBER(11) not null,
  MESSAGE_TYPE  VARCHAR2(32) not null,
  TIME_END      VARCHAR2(5)
)
;
comment on table MESSAGE_POOL_HIS
  is '消息池历史表';
comment on column MESSAGE_POOL_HIS.PK_NO
  is '主键';
comment on column MESSAGE_POOL_HIS.EVENT_NO
  is '事件唯一编号';
comment on column MESSAGE_POOL_HIS.CHANNEL_TYPE
  is '适用渠道类型';
comment on column MESSAGE_POOL_HIS.USER_NO
  is '用户码';
comment on column MESSAGE_POOL_HIS.CREATE_TIME
  is '创建时间';
comment on column MESSAGE_POOL_HIS.SEND_TIME
  is '发送完成时间';
comment on column MESSAGE_POOL_HIS.MESSAGE_LEVEL
  is '消息等级[小先发]';
comment on column MESSAGE_POOL_HIS.STATE
  is '发送状态';
comment on column MESSAGE_POOL_HIS.TIME_START
  is '固定发送开始时间';
comment on column MESSAGE_POOL_HIS.PK_HASH
  is '任务id';
comment on column MESSAGE_POOL_HIS.MESSAGE_TYPE
  is '消息类型';
comment on column MESSAGE_POOL_HIS.TIME_END
  is '固定发送结束时间';
alter table MESSAGE_POOL_HIS
  add primary key (PK_NO);


create table MESSAGE_SUBSCRIBE
(
  CHANNEL_TYPE    VARCHAR2(6) not null,
  MESSAGE_TYPE    VARCHAR2(32) not null,
  SUBSCRIBE_TYPE  VARCHAR2(1) not null,
  OP_USER_NO      VARCHAR2(32),
  SUBSCRIBE_VALUE VARCHAR2(32) not null
)
;
comment on table MESSAGE_SUBSCRIBE
  is '用户订阅表';
comment on column MESSAGE_SUBSCRIBE.CHANNEL_TYPE
  is '渠道类型';
comment on column MESSAGE_SUBSCRIBE.MESSAGE_TYPE
  is '消息类型';
comment on column MESSAGE_SUBSCRIBE.SUBSCRIBE_TYPE
  is '订阅类型[U R O G]';
comment on column MESSAGE_SUBSCRIBE.OP_USER_NO
  is '最后编辑人';
comment on column MESSAGE_SUBSCRIBE.SUBSCRIBE_VALUE
  is '订阅类型对应值';
alter table MESSAGE_SUBSCRIBE
  add primary key (CHANNEL_TYPE, MESSAGE_TYPE, SUBSCRIBE_TYPE, SUBSCRIBE_VALUE);


create table MESSAGE_TEMP
(
  MESSAGE_TYPE     VARCHAR2(32) not null,
  CHANNEL_TYPE     VARCHAR2(6) not null,
  SEND_NUM         NUMBER(2) not null,
  TEMPLATE_CONTENT CLOB not null,
  EMAIL_TITLE      VARCHAR2(200),
  TIME_START       VARCHAR2(20),
  TIME_END         VARCHAR2(20),
  IS_TIME          VARCHAR2(1)
)
;
comment on table MESSAGE_TEMP
  is '消息模板配置表';
comment on column MESSAGE_TEMP.MESSAGE_TYPE
  is '消息类型';
comment on column MESSAGE_TEMP.CHANNEL_TYPE
  is '适用渠道类型';
comment on column MESSAGE_TEMP.SEND_NUM
  is '异常重发次数';
comment on column MESSAGE_TEMP.TEMPLATE_CONTENT
  is '模板内容';
comment on column MESSAGE_TEMP.EMAIL_TITLE
  is '邮件/系统消息标题';
comment on column MESSAGE_TEMP.TIME_START
  is '发送开始时间';
comment on column MESSAGE_TEMP.TIME_END
  is '发送结束时间';
comment on column MESSAGE_TEMP.IS_TIME
  is '是否固定时间发送';
alter table MESSAGE_TEMP
  add primary key (MESSAGE_TYPE, CHANNEL_TYPE);


create table MESSAGE_TYPE
(
  MESSAGE_TYPE  VARCHAR2(32) not null,
  MESSAGE_DESC  VARCHAR2(100) not null,
  MESSAGE_LEVEL VARCHAR2(1) not null,
  TEMPLATE_TYPE VARCHAR2(1) not null
)
;
comment on table MESSAGE_TYPE
  is '消息类型表';
comment on column MESSAGE_TYPE.MESSAGE_TYPE
  is '消息类型';
comment on column MESSAGE_TYPE.MESSAGE_DESC
  is '描述';
comment on column MESSAGE_TYPE.MESSAGE_LEVEL
  is '消息等级[小先发]';
comment on column MESSAGE_TYPE.TEMPLATE_TYPE
  is '模板类型[实时模板、订阅模板]';
alter table MESSAGE_TYPE
  add primary key (MESSAGE_TYPE);


create sequence SEQ_LOG
minvalue 1
maxvalue 999999999999
start with 2108961
increment by 1
cache 20;


create sequence SEQ_LOG_DTL
minvalue 1
maxvalue 999999999999
start with 21
increment by 1
cache 20;


create sequence SEQ_SG_MD
minvalue 1
maxvalue 9999999999
start with 1601
increment by 1
cache 20;


create sequence SEQ_SYS_LOG
minvalue 1
maxvalue 9999999999
start with 539
increment by 1
cache 20;


create sequence SEQ_T_CLIENT_ID
minvalue 1
maxvalue 99999999
start with 29
increment by 1
nocache
order;


CREATE OR REPLACE VIEW SYS_ORG_ALL_VIEW AS
SELECT t."ORG_TYPE",t."ORG_CODE",t."ORG_NAME",t."UP_ORG_ID",
       sys_connect_by_path(org_code,',') AS up_org_list
FROM
  (SELECT 'instu' AS org_type,
          INSTU_CDE AS org_code,
          INSTU_NAME AS org_name,
          'root' AS UP_ORG_ID
   FROM admin_sm_instu
   WHERE INSTU_STS='A'
   UNION ALL SELECT 'org' AS org_type,
                    ORG_CODE,
                    ORG_NAME,
                    UP_ORG_ID
   FROM admin_sm_org
   WHERE org_STS='A'
   UNION ALL SELECT 'dpt' AS org_type,
                    DPT_CDE AS org_code,
                    DPT_NAME AS org_name,
                    BELONG_ORG_ID AS UP_ORG_ID
   FROM admin_sm_dpt
   WHERE dpt_sts='A')t START WITH t.UP_ORG_ID='0' CONNECT BY
PRIOR ORG_CODE = up_org_id;


create or replace view sys_org_view as
select INSTU_ID,ORG_ID,ORG_CODE,
       org_name,ORG_LEVEL,ORG_STS,ORG_ADDR,ZIP_CDE,CONT_TEL,CONT_USR,
       UP_ORG_ID,
       concat(sys_connect_by_path(org_code, ','),',') as org_seq
  from admin_sm_org
  start with org_level='1'
connect by prior ORG_id = up_org_id;




